Just to be clear, by transferred I mean given from one person to another, not necessarily by sale, as opposed to transportation.
Inherited guns by immediate family are legal except assault weapons. An assault weapon found by LEO in possession of someone must show proof of ownership or be subject to prosecution. A qualified estate handler will know to so advise the executor of any estate.
Nothing stops them from taking the weapon out of state, except discovery, and selling to someone else, again except that state’s law and upon discovery.
With few exceptions, firearms transported into California must go through a licensed dealer. If previously purchased, if I recall correctly, the dealer charges the owner to run a background check and confirm legal purchase of a legal firearm and whatever else the law may require. If brought it illegally, it’s again a case of discovery by a LEO and then possible prosecution. Just like with anything else that can't be brought into the state legally. Be it drugs, unstamped cigarettes or whatever.