It's a mechanics very similar to the one already present with merchants, only taxes should try to reach the capital and not just whatever city. The only problem would come up when a city is not reachable by land.
Defending the routes where the taxes go through would become an important strategy, since the economy of the empire or kingdom could suffer from their loss. That could also limit city spamming: a city too far from the capital would not be able to be economically productive thus becoming a weight for the empire.
later on a new building the "tax collector" could be build in, lets say any level 4 city, thus allowing certain options fot the routes. Smaller cities in fact could choose which city send their taxes to.
It's a mechanics similar to merchants: should be relatively easy to implement.