It all depends on what you actually do, but to keep your business status as a sole trader in the UK, you would need an English address. If you have one and you for example sell on-line services you could stay registered only in the UK. However, this wouldn't be totally legal, but nobody would track you to check how much time you spend in German and how much in the UK.
If you sell other services, then you could work in Germany as a UK sole trader, but not for a long time. There isn't really any definition what "long time" means, but basically speaking, everyone in the EU is free to do business in whatever country he wants to, but must register in the country where most of his business activities take place.
Many people register a limited company in the UK, and then register its branch in another country. Registering a limited company in the UK is much more easier than anywhere else in the UE, so is registering a branch of such a company. I'm not sure about the law in Germany, but for example if you want to register an ltd in Poland, you have to invest at least 5000 PLN in the nominal capital, and then pay about 1000 PLN a month for your insurance. Instead of this, people register a company in the UK, where the minimal capital is only a penny and you only pay insurance when you earn any money, and then register a branch of such a company without having to pay the "standard" Polish rates. It would be the same in case of Germany.
An alternative to being a sole trader would be a Werkvertrag in Germany. If you only work occasionally, you could sign a Werkvertrag without having to register your business.
And another thing - you could try to legalise your UK business in Germany, but apply to HM Revenue and Customs for a form A1 and work in Germany for to years and pay insurance in the UK. Then you would have to go back to the UK for at least 3 months and after that apply again for another form A1.
There are lots of possibilities, but as I said at the beginning, it all depends on what you do.