President Donald Trump has branded Elon Musk a "train wreck" after his former friend and advisor revealed he was starting his own political party.