I have done exactly that.
I had a US amateur extra class license when I moved to Germany. As a legal resident of Germany, I applied for and received a reciprocal (no test required) German license with the call DJ0IQ. Yes, it was a requested/vanity call sign to match my US call. The good folks at DARC (the German equivalent to ARRL) helped me with that.
During the time I lived in Germany, I retained my US W9IQ license since the only requirement to do so was to have a valid US mailing address in my FRN profile with the FCC. I could have retained my US license indefinitely this way.
When I would visit the US, the FCC regulations required me to use my US call sign. When I was travelling outside of Germany and the US, I could use the call sign most suitable to the situation.
When I moved back to the US several years later, I again updated my mailing address in my FRN profile and resumed operating with my US call.
While living in Germany, look up your local ham radio club - DARC maintains a list. It is a great way to meet local hams and get into local ham radio activities. The are also a number of ham radio swapfests in Germany. Check out your local ham radio dealer as well. I lived within 30 minutes from WiMo so I was a regular in their store. They even casually offered me a position at one point because they needed someone with strong English skills to support their international growth.
A nice, technically oriented, monthly ham radio magazine in Germany is FUNKAMATEUR. You can pick it up in all book/magazine shops in Germany.

More generally, anyone that can pass an authorized US amateur radio license exam may hold a US amateur radio license. There is no requirement to be, to become, or to ever have been, a resident of the US. You must, however, have a valid US mailing address in your FRN. Many non-residents simply use the mailing address of a friend, a colleague, or a mail forwarding service. I knew several European hams that held US amateur radio licenses under these circumstances.