en.wikipedia.org
It is usually caused by the female. When ovaries create eggs they only undergo partial meiosis. That is where the ovary splits and half of the DNA goes to one half, and the other goes to the ovary. In females the other half does not form an egg. Sometimes the split is not complete and an extra X stays behind. The ovary has both of her X chromosomes instead of only one. The result is a nominal male with various physical differences.
That is just one possibility. A person can also have XYY. They tend to have more severe acne, are a bit taller, 3" on average, and slightly less intelligent:
The cause appears to be similar to the XXY condition, but in this case the male sperm did not properly separate the Y chromosomes and a sperm with both of them got through.
Now this is just dealing with sex. Gender and sex are not the same Gender is how one's sexuality is expressed. But there do seem to be differences within the brain of those that are trans. This is not "make believe".