Self-declaration in the legal recognition of gender