Part of my Session 0 is that not all potential encounters will be level-appropriate. Then just train then that way from 1st level. Have them see some big foe in the distance that the decide not to encounter. Have a battle with a foe that can't catch them/has no reason to pursue (perhaps guarding a nest) that they can start to fight and then get away clean when they realize it's too much for them. Have an obviously numerically superior force but that doesn't want it to turn to bloodshed, so they see alternate solutions like RP, bribery, stealth, etc. are available options they can use if they are unsure about the opponent - or sure they can't take it. As long as you introduce it early and make it a recurring if rare issue, players will just get into the habit of evaluating if they want to fight something. Sometimes they can take something and won't fight it because they don't have enough reason to. I've been in a high level party (12th) that paid off rival explorers we are pretty sure we could have beaten just because we wanted to conserve resources for the forgotten temple we were in. Not enough reward to fight.
Oh, this really works best if you are using story award or milestones (either for XP or directly for levelling) instead of XP for encounters. If you only reward XP for encounters, players will (rightfully) expect that they can beat encounters.