One thing that could help to avoid it, is try thinking about any hero, or actor, or personage, which your boy likes a lot. And always, when he is talking about it, or you both look a film/read a book about it, mention to your son: “And X isn’t doing like you do in the store”, or similarly. The trick is, that children like to follow their role model, and if he knows, that the hero he likes does not behave like this, he may stop. Or it would be easier to stop him once the meltdown arrives. Also, another trick may help, if your beloved one tries to be “the big boy” a lot. Now same like in the first trick, show the examples of big boys, who do not behave like he. Hope this may help! Good luck.