As J says, there is no exception for non-residents passing through or visiting. You must meet the same requirements as residents.

There is a lot of bad drafting in this bill, and we can't guarantee that our interpretations of the legislation won't be superceded by subsequent litigation or other judicial interpretations. But at present, a non resident runs the same risks that residents do when in possession of magazines in excess of 15 rounds. We can't predict today, only a month and a half since the law became effective, which departments will or won't enforce, and which departments will apply what interpretations.