The US military is set to allow transgender recruits on January 1 after court rulings against the ban.