In making this pronouncement, Trump is infringing on the right of transgendered folks to serve in the military, in clear  violation of the second amendment of the U.S. constitution. Not that the NRA, or Republicans, or even the Supreme Court will call him on it. For reference the wording of the second amendment is:
"A well regulated militia being necessary to the security of a free state, the right of the people to keep and bear arms shall not be infringed"