Is it worthwhile writing about previous experience with courses, which will be taught in masters program, in motivation letter?
Anecdotally: I did this when I applied for CSE masters programs coming from a background in engineering. I highlighted the graduate level and elective courses I had taken in numerical methods, optimization etc. to demonstrate that I had interest in, and aptitude for, the courses on offer in the masters program. I also chose the professors from these courses for my references. 

I think it can be worthwhile to do this if it fits the narrative of your motivation letter as it shows that you have considered why you want to study these particular courses and why you would be a good fit for the program.