Hungary's new Prime Minister, Peter Magyar, has moved to oust the president, threatening constitutional action.