We aren't quite sure how gender identity works. Hormones play a part, but they aren't the whole story, and genes aren't the whole story either.
If you've read growing up stories about transgender children, this story in the Boston Globe, about twins in Maine (purportedly identical twins), one of whom is transgender, and the other of whom is not, rings true and is extremely familiar. This post recaps a lot of the same issues I addressed with more research rigor three years ago in response to some news stories in Colorado, and covers a lot of the same grounds, with the exception of the data point provided by the identical twin aspect of the Boson story.
Questions Of How and Why
In some ways, the notion that the two identical twins have such different personality is more notable than that they have different gender identity. While it isn't safe to generalize, certain most of the time transgender involves having XY genes and feeling certain that you are a girl, or having XX genes and feeling certain that you are a boy. Ergo, there is nothing conceptually impossible about genetically identical people not having identical gender identity.
But, twins aren't just clones of each other - genetically identical people who may be born to different gestational mothers at different points in time. Not only are they genetically identical, they also gestated in the same womb at the same time. And, yet, almost uniformly in the instances I've heard described, a conclusion that someone has a transgender identity manifests in a way that is almost impossible to ignore, even if you try very hard to do so, by preschool age - the article says the matter was absolutely undeniable by age four and manifested to some extent well before that point. And, given how difficult it is to make any sense of what infants are about in personality beyond one or two very basic dimensions, the inference that a transgender identity is probably congentital, even though it is probably not genetic (or at least, is probably not exclusively genetic) is a strong one.
The typicality of the case that the Boston Globe describes, in just one of two identical twins, suggests just a few possibilities.
1. Something within the gestational environment was different for one twin than the other, even though they were in the same womb. Thus, gestitational microenvironment might be involved. Maybe there was a different hormone balance at one end of the womb than the other at a critical moment for some reason like a residual estrogen accumulation from oral contraceptives taken at some point, or maybe a well placed kick to one of them during gestation took out the "turn into a male" circuit in one child but not the other by physically damaging it.
2. Something within the twining process wasn't perfectly symmetrical. Maybe one of the twins is a chimera of a lost fraternal triplet and the living twin, and the other is not, but genetic testing was at a locus where only the fraternal twin's genetic trace was detectable. Maybe there was a random hiccup in a key male or female identity moment of the development process that 99.99% of the time matches the genetic rule book but sometimes, in a rare process akin to a mutation but involved in the expression of that genome (perhaps an epigenetic mutation), there is a departure from the plan.
3. The trigger to a transgender identity happens post-natally in early childhood for who knows what reasons, perhaps related to some environmental exposure that happened to one child but not the other - maybe it was something not so unlike spiderman, maybe a mosquito carrying a particular rare version of a virus bit one and not the other, or bit both but only made it past the immune system of one of them due to something as random as having a cold at the time.
For what it's worth, if I had to, I'd put my money on an epigenetic mutation of unknown origin during gestation, quite possibly limited to neural epigenetics, as the likely cause, but I wouldn't bet the farm on any one of those options. My thought is that if there was a one time hormone exposure (which is possibly a more plausible mechanism for sexual orientation) that the XY genes would reassert themselves to some extent, albeit "out of tune."
For example, the notion that there might be a rare gene that makes it possible for the epigenetic mutation to happen, and that if that gene is present that the odds of an epigenetic mutation actually happening are one in six or something like that, is somewhat attractive, although I've near heard of transgender identities running in families in any of the literature on the subject.
Making Sense Of The More Complicated Than It Seems Gender Concept
All of this makes clear that the more subtle aspects of gender are real and inherent in people from some very early point in life, not simply a product of social conditions and environmental cues. I don't think that anyone who has seriously looked at the efforts that have been taken scientifically to determine if that is the case disagrees with that position at this point, although there are certainly differences in degree.
The conclusion may seem obvious, but after being taken for granted in a far simpler, two bin theory of gender that has been predominant for a lot of the time for a lot of history in a lot of cultures, from the 1960s through roughly the 1980s, the assumption that the aspects of gender pertaining to the mind were predominantly environmental and social in origin had a lot of currency.
Yet, the reality of transgender individuals is for gender what muons are for physics, something that nobody ordered or expected but that happens to exist. This reality takes nice simple grand unified theories of what gender is that fit 99.99% of the data and blows them out of the water. Sorry, Nature is telling us, explaining the last 0.01% (and these numbers are meant merely in the sense of very small number, not a specific actual value), is going to take a vastly more complex theory, but that is the reality of gender identity in the real world.
One can imagine a universe in which there are transgender and cisgender individuals. Indeed, in a lot of ways transgender identity is a much simpler to understand concept than the various concepts associated with sexual orientation. You have male hardware and genes but you mind and whole being insists that you are female, or visa versa.
Indeed, the profiles of people who are born androgonous but are genetically male, who are surgically modified in infancy to appear physically female and are raised female are remarkably similar to those of transgender individuals. The surgery never, or almost never, works, and despite all parental efforts the child made to look like and raised like a girl feels like a boy deep inside and nothing anyone can do can stop that train.
If you are willing to put the mechanism by which transgender identity happens in a black box (and you pretty much have to, in practice, because all of the usual suspects are ruled out) and simply get comfortable with the fact that there is a mechanism that isn't any of the usual suspects and that the mechanism in question is the one that really matters, it is all very straightforward to grasp.
Most of the cases described under the header of transgender identity fall neatly into a binary notion of gender. There just happens to be a mind-body discontinuity in these individuals, and since the mechanism by which sex chromosomes translate to gene expression in the body seems to be almost entirely mediated by sex hormones in the time period after birth, interrupting that process seems to be quite straightforward in theory, even if timing and technique require some doing.
If that were all there was to the story of gender it would be simple enough, but of course, it is not. The most obvious addition to the dimensions of the gender of the mind (which matches sex chromosomes in androngeous individuals surgically modified in infancy, and contradicts it in transgender individuals) and the gender of the body, is sexual orientation, which is crudely, if functionally summed up in the notion of sexual attraction, but is quite a bit more complex.
A gay man is not really even remotely the same thing as a male to female transgender individual, even though gender atypical behavior in both at an age consistent with the trait being congenital is very common. A gay man doesn't generally feel internally that he is a woman (although a transgender gay man is a conceptual, if extremely rare, possibilty), and a lesbian woman doesn't generally feel internall that she is a man. Homosexual and hetrosexual sexual orientation would seem to leave four kinds of self-concepts, gay male, straight male, lesbian female, straight female. But, in fact, sexual orientation isn't as simple as a binary thing. There are quite a few non-straight women, and not as many non-straight men, who have stable bisexual identities. There is some sense that there is stability in the characterization of butch or femme lesbian, and an analogous distinction for gay men, although what is going on in these contexts has as much basis in the intuition of people who live in the situation as it does in any consensus description of the reality.
The whole sexual orientation concept also turns out to be far more deep rooted than one might expect, and in some cases very simple. One can flip a genetic switch in a fruit fly or mouse and make him gay. Blamo, scientists have identified single tweaks in single biological systems that will do the job every time. Apparently, our genes carry both male and female instruction books on instictual gendered behavior in one or more domains (including, of course, sex), but generally we only have the fortune, or misfortune, to have access to just one of those sets of gender programing in our lives.
There are continuum and binary notions of sexual orientation. It isn't at all obvious that what we call sexual orientation in men and what we call sexual orientation in women are precisely equivalent concepts flipped only by a body gender-mind gender coupling to sexual orientation. There are scholars, I'll call them gender theorists for want of a better term, who think that what is going on in bisexuality, in particular, is very different between men and women, and that sexual orientation is more binary in men than it is in women. It also isn't at all clear whether there is one master "sexual orientation switch" that is behind all of this, or if multiple mechanism lead someone to consider himself, for example, to be a gay man, and all of the different categories of people who consider themselves to be gay men seem to be in one group simply because the phenotypes are similar enough to be compatably treated that way and we don't really understand what is going on.
But, anyway, in addition to the point that sexual orientation is a much more conceptually fraught thing than cis- versus trans- gender identity, there is the point that there is more to sexual orientation than attraction, and that a gay man is very much not, for example, either a straight man or a straight woman.
Then, there is the question of whether a transgender identity is really binary. In an extreme, obvious kind of case, like the one described in the Boston Globe; the archaetypal case, it is that simple. But, what about tom boys who still unambiguously think of themselves as women and are attracted to boys, and what about men who have some steroetypically feminine interests or personality traits but unambiguously see themselves as male and are attracted to women. Is this different in kind than what we see in transgender individuals, or just different in degree? Is there any deep down commonality between someone who cross-dresses for shits and grins with their same gender pals because that is normal for their culture, and someone who cross-dresses because it reflects their conception of who they are as an individual deep down?
And, all of this doesn't yet address the question of people whose bodies are androgynous or whose genes have extra chromosomes (or lack chromosomes) associated with one gender or the other. Furthermore, don't forget people who are hormonally neutered in some way (e.g., castration, disease, chemically), who themselves differ based on the point in life at which this happens, and differing cultural roles for men and women.
One starts out with an extremely two bin system that explains 90% of reality, and before you know it, you've got a blur of concepts - chromosomonal gender, hormonal gender, body phenotype gender, self-perception gender, attraction gender, personality style and inclination gender, and other blends and mashup of these dimensions.
Managing Daily Life Like A Decent Person
Practically speaking, modern, reasonably tolerant people tread cautiously, take people's self-identity at face value, and do what is practical to realize workable arrangements that make everyone happy. this works quite well in real life, respects the dignity and worth of everyone involved, makes people happy most of the time, and has the virtue of not necessitating an understanding of precisely how any of it works, which we don't have available to us. And, people who haven't happened upon that realization cling to the two bin classification system, try to fit everyone into it, and reserve words like disgusting and abomination to anyone who is a round peg that won't fit in a square hole. But, the writing is on the wall in the Western world and the people in the first category are becoming culturally dominant in a transformation that has already been dramatic in basically two generations.
Post-puberty, without medical intervention, trying to follow the "go with the flow" game plan all gets much more inconvenient for transgender indiviudals. Puberty brings about irreversable changes in a person's body, and bringing about some sort of congruity between the gender identity of the mind, which transgender individuals usually want to have honored in daily life, and the way one presents at first glance, can be a devilishly difficult matter to manage, particularly so in the male to female dimension, since it is in practice easier for a woman's body to pass for not particularly masculine young man or old boy, than it is for a very masculine man's body to pass for a woman's.
Sexual orientation, which doesn't have the same kind of disconnect between your body and who you perceive yourself to be, doesn't post the same kinds of problems. A gay man may have a different instinctual playbook than a straight man or a straight woman, but he generally doesn't want anyone to treat him entirely as a woman, so there isn't the same need to tinker with one's body physically via medical professionals.
Looking forward, the big questions in my mind are whether our conceptual framework for these concepts will become better defined at some point in an accurate way, whether we will every learn how this comes to be from a mechanism point of view, and how our culture will continue to adapt.
As they say, interesting times.