U.S. appeals court hands win to Trump on transgender military ban