The US will remove transgender troops from the military unless they obtain a waiver on a case-by-case basis, the Pentagon said.