Transgender people can be legally excluded from single-sex spaces in certain scenarios if there is ‘a sufficiently good reason’, the equalities watchdog has said.