Former US president Donald Trump’s attempted assassin has been charged in a federal court on 2 counts of gun-related crimes.