A federal judge in New York has sentenced a German-Canadian man to two years in U.S. prison for stealing trade secrets from Tesla in order to build his own company in China.