When you guys say it's completely alright,I hope you realize,that it's very different from uni to uni.I will share my experience of attending half a semester of lectures without being enrolled at the college,which is one of the top5 in Europe in this major.
1.Do your homework beforehand
The first thing you have to ask yourself is "is it worth it attending the lectures vs. learning by yourself.If you are smart,most often sitting in halls is not the best way to spend your time.So first research if the local uni is one of the best in the country in that subject,which are the best classes to take,best professors(quora can help with that).Next,go on the unis website and see how accessible to the public are the lectures' timetable.Decide which classes you want to take and make yourself a schedule.Also think about whether you can handle the classes and what area are they in.In certain subjects,the smaller group practical work has more value than the lectures...If it is CS, don't know if you can attend the practical work,as you will probably have to log in the network or online if you don't bring your laptop or sth has to be looked up.That is where you'll get caught.
After some googling on the subject,the best discussion I came across was on metafilter,which is a great forum with very intelligent people by the way.The conclusion was,even pointed by a few professors,that they would let you sit in,if asked and would kick you out,if they found you attending,without being enrolled or asked them politely in advance.That's definitely the moral thing to do.Attending somebody's class is similar to eating dinner at their house.Most of their emails are easily accessible,so you can either contact them in advance,or wait or them in front of the first lecture in front of the door.The rules I'd stick to are being very respectful,the man is doing you a big favor and putting emphasis on how hard do you want to learn and how committed are you to this.Add that you'll be the first to come,the last to leave class and make sure you make the most out of what's being taught through dedicated and hard work.Even if I just had a healthy child born,I'd still not let you in,if you gave off the vibe or said directly that you find this "a good opportunity to exercise some brain cells I wasted overseas".A lot of unis,especially the American ones,have the opportunity for outside students to take separate classes for a fee.So if you don't come off as very poor,very young and even more hungry for knowledge,you're done.
The downside to asking in advance is some may reply: "you can only attend the first couple of lectures",or "Unfortunately/I am sorry,but....NO". And from there it's probably a no go to come back for lecture 2 if the lecturer has a good memory.That's the reason I chose not to risk it and sneak in instead.
2.Security
Depending on the university,some have personal cards,like UCL,don't know how easy it is to obtain one.It may be go wherever you want,once inside,but there are cameras and security that follow who goes in.At other unis,which were even better,it's a lot easier.
Now you are already in the lecture room.I was usually sitting in the back,you can choose where to sit yourself and whether to keep yourself low key and talk to nobody or be one of the most active in the room, make friends with the students and pretend you're studying there.Again depending on how far you wish to take it,you can just attend lectures and receive free material,or you can try to get into labs too.Be calm,Frank Jr
Again to underline-ask yourself first what lecture is worth attending vs studying at your own pace at home!Which college are you talking about?B or LA?The rest aren't very good for most things.If you want to ask sth or I have anything to add,I will update