It is the security tag that emits a high frequency radio signal when passing through the alarm system. It is possible that you were in the general area when someone set the alarm off and your dog connects the exit alarm reader and the loud uncomfortable to the ears sound.
Great deduction of a possibility on your part. I would start doing a lot of work walking through when light traffic and try to stay back when busy. Then work your way up till dog is comfortable even with the distraction. Might be a good idea to have a great treat in your pocket when you go shopping and treat this as a training under distraction. Of course it may be quite awhile before an alarm goes off when you are nearby. Maybe you could just allow her to nibble on a treat as you go through them for a bit - go down to just reward on the way out - and then give treat only outside of store before taking treat away altogether. (I am not a believer in giving treats while in a place of business but this may be one of the few times I would approve if done very discretely.)
On this training with a possible distraction, I would of course NOT
recommend having a helper set off the alarm on purpose -- I'm sure security would not be pleased.