Will Riker did have a relationship with a “person” who was from an androgynous race on The Next Generation.
The androgynous alien was clearly female looking. They wouldn't have dared make it clearly male looking. They were trying to push the tran-gender trans-sexual motif with that episode, but they clearly knew if they exceeded a certain limit, the fan backlash would have been massive.
As it was, a few minutes into that episode I was disgusted and turned it off. I still don't know how it turned out.
I think that episode is one of the worst examples of political propaganda pushed by the series and disguised as "entertainment."