Tuition paid with student loan proceeds is a qualified education expense for purposes of the education credits.
For more information on qualified education expenses, see IRS Instructions for Form 8863 Education Credits (American Opportunity and Lifetime Learning Credits).
Note that any link in the information above is updated each year automatically and will take you to the most recent version of the webpage or document at the time it is accessed.