To add a little to Doctor_Hoot's message: as someone that is going through real-life, non-magic, medical transition, that too changes your thoughts and personality. It turns out we're all just a bunch of chemical reactions, and so of course when you affect those reactions it also affects your... self.
Honestly it's sometimes a little scary to think of how much I mentally changed just because of a few accumulated grams of estrogens; I've been feeling a little more sensitive and emotional over things in a strange "this isn't like me" way, and I've also been a lot more confident in my woman-ness despite not that much having actually changed.
Transition isn't the only thing that might change "core" parts of your every day mental experience: anxiolytics, antidepressants, stimulants, etc are all drugs that affect your thoughts, feelings, and sometimes identity. So I really don't understand why people are struggling so much with the idea that a character's psyche (incl. identity) might be altered when going through anime-magic transition.