It's quite a blunt description, necessitating the exposure of genitals:
https://www.legislation.gov.uk/ukpga/2003/42/part/1/crossheading/other-offences
Exposure
[F1(1)A person commits an offence if—
(a)he intentionally exposes his genitals, and
(b)he intends that someone will see them and be caused alarm or distress.
And a bit further down the page:
Sexual activity in a public lavatory
[F14(1)A person commits an offence if—
(a)he is in a lavatory to which the public or a section of the public has or is permitted to have access, whether on payment or otherwise,
(b)he intentionally engages in an activity, and,
(c)the activity is sexual.
(2)For the purposes of this section, an activity is sexual if a reasonable person would, in all the circumstances but regardless of any person’s purpose, consider it to be sexual.
(3)A person guilty of an offence under this section is liable on summary conviction, to imprisonment for a term not exceeding 6 months or a fine not exceeding level 5 on the standard scale or both.]