Former US President Donald Trump has sued New York Attorney General Letitia James seeking to end her civil investigation into his business practices.