Hello TH5353350, I hope your day is going well! You are allowed claim student loan interest for yourself, your spouse, or for someone who was your dependent at the time the loan was taken out. You must be legally obligated to pay the loan as well.
If you cosign and are legally responsible, and the child was your dependent at the time the loan was taken out. Yes, you can claim the student loan interest paid. I have added a link to IRS resource.
https://www.irs.gov/taxtopics/tc456