Hormones do play a massive part, it's true, but I don't think they tell the whole story.
I'm a trans man, I've been on testosterone for almost 8 years. I did experience dramatic mental change, in the sense that it brought an immediate end to the chronic depression I'd been living with for the previous three decades. This led to me becoming more emotionally stable, more self-confident and more assertive. What it did not do is change my personality in any way. My level of aggression, competitiveness, risk-taking, empathy, sensitivity and all the other things that we tend to ascribe to gender, remained the same.
Gender isn't in the genitals, nor is it entirely in hormones; it's primarily in the brain, in the way neurons link together and operate. Studies have shown that trans people, even before treatment, tend to think in a way more typical of the gender with which they identify, not the one they were landed with at birth. But again there's still a massive overlap and the link between thinking-style and gender identity is still pretty loose. In fact, if it was solely to do with hormones, there would be no trans people at all, except for those who have abnormal hormone levels. Everyone who produces natural testosterone would identify as male and everyone who produces estrogen would identify as female. In reality, that isn't the case, so there has to be other factors in play.
And it's not nurture either, otherwise there would be no trans people who were raised within a traditional gender-segregated environment, there would be no trans people with cisgender siblings, and again that's not the case either.
Science's best guess so far is that non-typical gender identity is the result of environmental factors during gestation; and by environmental here, I mean things that are happening inside the mother's body during the first trimester of pregnancy; varying levels of hormones in the uterus. But no-one yet knows the mechanism by which this happens. And it's almost impossible to study, because by the time a person becomes aware of their their gender identity, it's already years too late to determine what went on in-utero, six months before they were born.
Gender isn't two points on the ends of a line. It isn't even a line. It's more like a ball-pool. Pick one or more, any colour.