I don’t think it needs to be mean spirited to be transphobic. The implication seems to be that he is tying to determine whether a sex worker is trans by asking if they are a boy. There’s probably a better way to word that question, but then it wouldn’t fit the meme.
That’s a very charitable interpretation.