They're always "on duty"
Whether in or out of uniform, a LEO is always thinking like they are working - training changes a person, and it tends to keep them alive on- and off-duty, so it's understandable why they conduct themselves as they do 24/7.
Yes, you're being "checked out," like it or not - but it's not always a bad thing. Pass the "attitude test," and you'll likely just have a short, friendly conversation, be left alone afterwards, and possibly in the future by that same officer (jurisdiction dependent, of course!)
Anecdotally, my cop buddy is genuinely into guns, and likes to ask folks about theirs - how they like it, how it shoots, any mechanical issues, what loads it likes, etc. - because he might like one for himself.
Of course, we read too many accounts of LEO encounters that are not so innocent, so YMMV.