Court rules on Trump's transgender troop ban