Meeting and engaging with locals is very easy in my opinion here in Madrid.
From the first day on we had the opportunity to engage with all the internationals. There was a welcome-day planned where everybody got to meet one another and engage with each other. Afterwards you could stay at school for pizza with other international and local students, and I did. I was very happy i did that because the group of people we formed that day, are still my close friends during this semester!
For all the international students, there were 2 buddies assigned that organised events and parties. You just had to add yourself in a Whatsapp-group to get all the updates, as well as in a Facebook Group. Every week the buddies organised little drinks in a pub, a beerpong-tournment etc. This was very fun, but it kind of frustrated me that only other international students came to the events. It was very fun; don't get me wrong, but I wanted to meet local Spanish people as well.
In Madrid there is an organisation called Citylife Madrid, which kind of organizes a lot of different things for internationals. They take care of your official appointments, metrocards,... But also organise a party or activity everyday! And to those events, local spanish people went as well. On Monday there were free salsa/bachata lessons, which I attended every week and met a lot of locals, who became close friends as well!
Engaging with locals became easier once my Spanish became more fluent and I got to know the city a little better! After 2-3 weeks I had a great balance between engaging with other internationals and meeting with locals.