Should I mention in my statement of purpose that I did not attend lectures in my last two years of undergrad?
I'd shorten and tone it down if I were you. Being a researcher involves a lot of sitting in other people's talks, so we all know that lectures are boring. But we still do it, because those are an excellent chance to socialize. We might just pack a paper to read in case it gets too boring. So your statement makes you look a bit like a loner. And being able to study something without being present in a lecture is a skill I'd assume anyone with a degree has. I don't think anyone ever finished a degree where all lecturers are perfect explainers and there is no need to study something on your own at some point.
So while I would not necessarily view your explanation negatively, I also don't see it as helping you much. So while you should explain your bad initial grades, I'd keep it short and simple. Something like &quot;Coming from a non-academic family background I struggled initially, but then I changed my approach to studying&quot; without going too much into detail.
Finally I think there is also a bit of an &quot;I am very different&quot;-undertone in what you write. It makes you seem aloof and possibly difficult to work with. This is again minor, but in direct comparison with a similar candidate it could tip the scales against you.