The UK Supreme Court is debating the legal definition of a woman after a long-running battle in the Scottish courts.