New guidance has been published that sets out the way trans people should be treated by businesses, hospitals and sporting bodies.