I don’t know if it’s still true, but it at least used to be the case that one could ask a professor’s permission to just show up for lectures even without any formal relationship with the school.
AFAIK in many countries and universities around the world this is no problem in 90% of the cases.
Good professors are more than happy to have you there. One I even asked to take the exam, and get it corrected (to test if I really learned the content). And they allowed me to do that, I got the corrected exam at the end. Of course, it was not written in any book in the university.