Start with assuming the best about people. It might surprise you that most hiring managers have no interview or HR training! Some are just, in their minds, trying to have a conversation with you and have no idea their questions are illegal. For example, they might want to have someone work in the local geography a year or two but then move to corporate, so want to know you ability to move. Or, maybe the job requires lots of overnight travel and they want to make sure that this works with your life needs. There are right and very wrong ways to ask for that information. It is easy, especially if you hate canned questions, to go the wrong direction.
So, whether or not you get the job, give the manager a courtesy call. Preface your discussion with the saying you weren't put off and aren't planning any action (avoids a defensive reaction) but wanted to share that question ---blah, blah, blah --- might not be acceptable with today's HR rules, that it could be taken wrong. End by saying how much you enjoyed meeting with them and appreciate the opportunity. Even if they knowingly broke the rules (and you'll know based on their reaction), this approach let's you deliver your message without lowering to that level, and even better, if they don't know and made an egregious mistake, you have a hiring manager that will remember you for the next opportunity.