regarding how genes and environment shape one's personality, i read this book written by two tv personalities who've gathered a good variety of studies on this. they only presented the most controversial theories on tv (which caused lots of discussion), but the book is actually pretty sensible (unfortunately i put the book in a place i can't remember where was, so i can't quote any single source)
they presented one study of identical twins where they found that twin who were separated at birth would usually grow up to become ever more similar the older they got (some would even smoke the same brand of cigarettes), whereas twins who grew up together would develop more distinct personalities and tastes. and of course many more studies, even of intersexed and transsexual people
anyway, what i got out of it was that personality is in your genes, but can be tweaked a good deal based on environment. like how twins who grow up together will feel a greater need to form their own identity so they develop different personalities, while those who don't grow up together don't have the same need, so they don't tweak the core they were born with too much. it also suggests that one's personality is highly influenced by the environment when one is young (because of a need to be taken care of, so kids will often do whatever they can to be what they think they're expected to), but this influence weakens as one gets older, and one gets closer to one's "real" personality
i also strongly believe that if something outside of myself changes me in any way, then it's because i'm predisposed for it. since there are other people with the same experiences who don't react the same at all. but blaming things on the genes is taking it a bit too far, since flexibility and ability to conform is also in the genes. the book also presented a study where they found that kids tend to have their own interesting taste in colors until they (usually) at around age 3-4 suddenly learn that boys don't like pink, while girls have to like it, and choose according to this. a couple of years later, when they've established their identity as part of their gender group, they suddenly start to show more integrity in color choice again
interaction between genes and environment is really interesting. the most important reason to believe in genes (at least to a certain extent), is that when genes dictate that someone's a boy, then environment can't do anything to change this. if environment gave this person the wrong chromosomes, the wrong body type, changed his body at birth, he still remains a boy. what part of the genes has to do with gender is still very uncertain, though, and it's probably so complex that scientists will be surprised more than just a few times when they think they've gotten closer to the answer
(anyway, this is just my conclusion from what i've read about it, there may be evidence suggesting otherwise. if you know of any, please inform me)
and now to the op's actual question... i think both gender and personality is decided mostly by genes, but also by environment. gender might be less influenceable than personality, though. they also don't work in the same way and aren't parallel to each other in any way. a cis woman can have the common personality traits of a cis guy and still be female. i'm pretty sure that the same goes for trans women too, but it might be a lot harder for them to show or admit it, since people would start questioning their "choice" of gender
(i hope i don't offend anyone with this, btw. i don't mean to, but i might have written something wrong without realizing)