The best solution to that is simply to regulate as little as necessary, and leave as much up to the market as possible. A good example is infrastructure and utility deregulation in the U.S. and western Europe in the 1980s-1990s. There was a time when government regulators would set, e.g. prices for electricity. Today, electric markets are mostly deregulated, with only distribution utilities remaining as regulated monopolies.
It would be interesting to see research on various solutions around the world. One obvious solution is paying people market rates for their work; then they don't have an incentive to work in industry. One way government has done that is by providing job security and regular hours as a perk to compensate for lower pay.
In the U.S., the Republican Party (I'm not saying it to be partisan; it's just fact) had been trying to cut pay, cut job security, and also cut personnel, which increases the workload. It's not hard to see where that might lead.
On the downside - restrict employment opportunities for X years after being in a specific position.
Clearly both have issues, but regulatory capture is a problem worth solving.
Also, as far as time bars, the PTO does something like this. Former examiners are not allowed to apply for a patent for a term after they leave. Doesn’t really solve the problem, but it’s something.
Are there any laws restricting companies from "lobbying" regulators or engaging in quid pro quo?