Transgender identity in the twenty-first century is a fragmented thing. Is your gender identity something you're born with, or something you acquire? Is it a bit of both? It's interesting to look at literature from different periods to see whether the depiction is more essentialist or its theoretical opposite, social construction, and why this is so.
Ebershoff's The Danish Girl is a good place to start with this discussion, and to see an essentialist portrayal at its most visible. Although a work of fiction published in 2000, it is based on a mixture of primary and secondary sources dating back to the 1920s and 1930s, concerning one of the first famous male-to-female 'transsexual' cases, Lily Elbe, and her exposure to one of the first gender-reassignment operations.
Biological innateness is at the core of Lily's situation. As she begins to present as female, her body appears to change: her wife notices how Lily's hips have become more pronounced, her scent and voice become more feminine, her calves soften, and her breasts start to develop. All these things happen without the aid of hormones or therapy. Medically, this is the stuff of fantasy. The relationship with wife Greta, meanwhile, fits into a narrative familiar to transvestite pornography: the process of Einar becoming Lily begins because Greta wills it. It is Greta who requests Einar to model as a woman, and who arranges for Einar to go to a public function as Lily. Indeed, it is Greta who comes up with the name of Lily. As a further aspect of the fantasy, we are constantly told of Lily's attractiveness to men, and her effortless ability to pass as a woman, from the get-go. Such duck-to-water transitioning also underlines how this is a story of surfaces; we get many more descriptions of Lily's clothes and physical sensation of touching women's clothing, than we do of any introspection from Lily. As soon as she is Lily, she is simply a woman.
Einar, then, transforms into Lily, due partly to the persistence of his wife, and partly to the biological determinism s/he is helpless to resist. It is as if her body is expunging itself of the male identity that was imposed upon it from childhood. It is a motif recognizable in the Gothic horror of cinema, eg with the scientist whose DNA is turning him into something against his own will (eg The Fly), or more directly, of the man turned into a woman as a form of punishment (The Skin I Live In; ReAssignment). Unlike those films, however, Einar is not wholly resistant, and desires the transformation for the good of his survival.
Such a fantasy is easy enough to understand. Little was known of transsexuality in the early twentieth century, and the story may be seen as Lily Elbe's personal attempt at making sense of her gender dysphoria. Even today, in 2016, we see feminist arguments claiming that female identity is innate and womanhood a closed club, with male-to-female transsexuals unwelcome. The fantasy of under-the-surface hermaphroditism is one person's attempt at a response, in pleading for acceptance, understanding, and legitimacy as a woman, with the most fantastical demonstration of biological determinism possible.