My usual predictable trans-adjacent take:
Maybe Riko was "always" a girl mentally and just didn't know it. That would handily explain why there was no memory rewrite -- there was nothing to actually change.
I'm also playing with the idea that Yunagi kept her memories too but is playing a long-con. And despising who she used to be once she became her true self is why she's so harsh on men. I see that a LOT in my circles, a sort of overcorrection.