A lot of us locals take part, but you can too, everybody can. You don’t have to be a citizen, you don’t have to be German and you don’t have to apply or buy a membership for a specific period.
All you have to do is go to the city hall or one of those places where they also sell tickets for concerts, buy a single ticket for “Freizeitsport” (leisure time sports) for 3.20€, pack your clothes and sneakers and go to one of the 40 indoor sports halls. These are mainly the halls of public schools not used during the afternoons and evenings and they are spread all over the city. So you will always find one close to your hotel or apartment. But be aware that the trainings pause with every school holiday, when the schools are closed: 6 weeks in summer, 2 weeks around Christmas and Easter…
The program offers all kind of sports and gymnastics, from basketball to yoga. You have to check on their website when they offer what and where. The website and the pdf are in German only, but you will understand enough, because all you need to verify is the name of the sport – which are the same all over the world – the place and the time. You go there, take part and at the end handle your ticket over to the coach who runs the training. That’s it.
This is also a good way to get to know some locals by the way.