There is a very simple way to deal with this issue.
No sex between active duty military members, whatever their sex, gender, self-perception, or other flavor of the week. Make sex between members a criminal offense, as the military already does with adultery. It should be a felony in peacetime, like adultery, but a very serious felony during wartime or a deployment in a combat zone.
No need for touchy-feely classes on what this or that sex or gender might consider an offensive proposition, no specially trained investigators needed either.
Ban sex in military and lock up everyone engaged in it. Military already married to military members might have to be “grand-fathered” as offensive as that term might be to some. But no more marriages should be allowed between military members after a certain date.
See how easy it is to solve the problem? Warriors don’t have sex with each other! Real simple.
Does your ban include “self-sex”?