(5)When a person subject to this Act is sentenced by a court-martial to transportation or imprisonment, this Act shall apply to him during the term of his sentence, though he is cashiered or dismissed from the Air Force or has otherwise ceased to be subject to this Act, and he may be kept, removed, imprisoned and punished as if he continued to be subject to this Act.