To be eligible for the tuition credits, the course must be taken at "an eligible institution". The school should be able to tell you if it is an eligible educational institution. In general, an eligible educational institution is an accredited college, university, vocational school, or other postsecondary educational institution, including accredited, public, nonprofit, and proprietary (privately-owned, profit-making) postsecondary institutions. Additionally, in order to be an eligible educational institution, the school must be eligible to participate in a student aid program administered by the Department of Education.
Many foreign schools are on the list.
Enter your school at the link below, to see if it's on the dept. of education list.
https://www.savingforcollege.com/eligible-institutions
You cannot claim the American Opportunity Credit if the school is unable to provide a U.S. Federal Employer Identification Number (EIN or FEIN). You can still claim the Lifetime Learning Credit if the foreign school is on Dept. of Education (DE) list.
Foreign schools can obtain a US EIN
https://ttlc.intuit.com/community/college-education/discussion/ein-tin-for-vrije-universiteit-amster...