Take a few courses in another university I'm a foreign (non-EU) student enrolled at the CS master's program in a European university. 
I would like to take 2-3 courses that my university doesn't offer, and the first idea that came to mind was to take them at another university (preferably also European) in another country. 
Obviously I want these courses to be counted in my diploma (assuming that they fit my program).

What you would do if you were in my place? Is there any "general" approach to my problem?

From what I've found there are a few ways:


Go as a free mover and enrol to the courses individually (seems that not all universities offer this option)
Go as an Erasmus student (not sure if I qualify being non-EU citizen)
Go by direct exchange program to the university that have bilateral agreement with my university (in my case, I'm not satisfied with offered transfer destinations, so it's not really an option)
Something else?


UPD: 
I assume there are 2 general cases: 


My university and the university I wish to go are "partner
universities", i.e. they have some sort of mutual agreement 
They are not "partners universities"
Go by direct exchange program to the university that have bilateral
  agreement with my university (in my case, I'm not satisfied with
  offered transfer destinations, so it's not really an option)


That would be the easiest way.


  Go as an Erasmus student (not sure if I qualify being non-EU citizen)


If you are not qualified for Erasmus, you are certainly qualified for Erasmus Mundus. Just talk to the Erasmus coordinator at your university. If you are going with Erasmus they (should) have already taken care of the getting credits problem.

If all that does not work out, you could also organize it yourself. That is more work but sometimes worth it. Then you have to take care of most of the things yourself:


Funding: 3 possible sources come to mind: the country you want to go
to (for Germany that would be DAAD, but similar options also
exist in most EU countries, e.g. France or Belgium BAEF), the
country you are comming from, or your home country.)
Credit: Talk to the director of your program/ the dean of student
affairs / international relations person
Enrollment in the foreign university. You also have to apply there.