Victoria Police has lost a legal battle with a transgender woman over a transphobic referral, and has issued an apology