I think it all comes from a good place, though I'm thoroughly confused as to whether Japan distinguishes between being gay and transgender. He calls himself "Sylvia" in the JP version of the game, and I seem to recall him speaking using feminine langauge, feminine pronouns etc. It's been quite a while though. He's more or less an "okama" stereotype, but the game portrays him in a positive light, and he's more than just the butt of jokes. He's meant to be seen as just as badass and capable as the other characters in the game, and has a character arc that affirms his identity.