Most supermarkets and big-boxes (Super Walmart, Super Target, etc) now have POS systems that prompt the cashier to check ID whenever an age-restricted item is scanned. Several years ago I worked at grocery store that had an older POS that only prompted for beer, wine and cigarettes, and I found that I could buy non-alcoholic beer at that chain because the system didn’t prompt for an id check. At other chains in the area that had newer systems, the non-alcoholic beer did prompt the id check, so I couldn’t buy it there.
So I would imagine that it has a lot to do with the store that you’re shopping at, and what items are listed as age-restricted in their computers. If the computer tells the cashier to check id when she scans the item, she will, and if it doesn’t she most likely won’t bother. It may be perfectly legal for you to buy non-alcoholic beer if you’re underage, but it’s might difficult to convince a cashier looking at a screen prompt to check ID, unless you just happen to have a copy of your state’s laws in your pocket.