US President Donald Trump has slammed the UK government for ceding sovereignty of the Chagos Islands in the Indian Ocean.