This depends on what proportion of your total activity is made up of your activity in Germany. If your activity in the State of residence reaches 25% of your total activity, both activities are subject to German law. If this is not the case, both activities are subject to the legislation of the other EU Member State.
You should apply for the European Health Insurance Card and the A1 certificate attesting to the applicable legislation from your competent sickness insurance institution in good time before starting the additional activity abroad. Information on this can be obtained from your statutory sickness insurance institution or the Deutsche Verbindungsstelle Krankenversicherung – Ausland (Foreign Liaison Body of the German Sickness Insurance Institutions – DVKA), which also provides the application forms required to obtain an A1 certificate.