If you understand a bit about neural networks already, and want a deeper, probably more accurate, model, go watch Computing Like The Brain, by Jeff Hawkins.
The part of the brain he describes is just the Neocortex, not the cerebellum or brainstem, or amygdala, the older mammalian and reptilian components which will be the centre of fight/flight, basic survival (food/comfort), and reproductive drives.
It's the neocortex that starts out as a mostly blank slate, (In his words, 'It has structure, but it doesn't have content'), which learns to find associations between patterns of sensory experiences, and to predict outcomes of repeated patterns, and connect sensory experiences with motor actions and the feedback from the emotional system, and so on.
So if you are born with a penis and you wear a dress or put on some makeup as a small 'boy', and you just find it fun and exciting, but your parents find you and catch you and they don't find it so fun or exciting, so they give you a very firm emotional stimulus in the opposite direction, well soon, like pavlovs dog, the idea of putting on a dress will somehow fill you with dread, and then the idea of putting on a dress will just not occur to you at all, and you have a 'complex' about ever being caught acting too much like a girl again.
Really the big problem seems to be all the women going around thinking they are men, rather than the men going around thinking they are women, but anyway...
So if you are transgender it's because of your cerebellum, brainstem and amygdala, but if you have a major problem with it and end up splitting your brain in half, and one part goes to work and the other part goes to your private fantasy space, well, that's because of your neocortex and the strict binary of socially acceptable behaviour defined by the environment that you were brought up in.
Yes, most spirits are quite androgynous.
People like me are a bit of an anomaly.