How do they know?? Obviously, they don't. But, practical difficulties in enforcement never got in the way of a good gun control law, that I know of...
Also, specific to this law, its not the guns that are being restricted (there are other laws covering that) it is just the magazines.
How would they know you went out of state and bought more? Without you being foolish enough to retain proof of where and when you got them, they won't. BUT, if they should happen to "catch" you on your way home from out of state with them, you might have your day in court....
And remember with things like this, they don't have to win a conviction for you to lose. What I mean is, even if you beat the charges, the cost of doing that is a net loss. A win over going to jail, sure, but otherwise a loss that decent folk should not have to risk enduring.
As to inheritance, there's the whole "burden of proof" thing. It SHOULD be up to the state to prove criminal wrongdoing, but remember, we're talking about "evil" gun parts here, things who "only purpose is to facilitate mass murder" and who knows whether a rational, or a fanatic attitude about guns will dominate those who sit in judgement of any specific case.
It MIGHT be that absent specific proof of ownership before the law's effective date MIGHT be considered enough proof to rule they are contraband. Is that right? Hell no! Is that possible? sadly, yes...
MOST people will not have their guns (and particularly gun accessories) individually listed in their wills. It is possible some court might decide that without that, your heirs claims are just hearsay, with no legal weight. Sad, but not impossible.
It shouldn't be that way, but it is what we're stuck with until/unless we get a court ruling tossing these laws into the crapper where they belong.