The first thing would be the universal expectation and recommendation of it. If they saw as they were growing up that this is what people were praised, rewarded, and remembered for, and even more importantly, that lacking social duty is what people are reviled for (like being known as a racist in today's society), it would leave a strong mark on them.
The other thing would be when their understanding of life and death was tied to the necessity of social duty. For instance, as a merchant's child, they would learn the business from their parents, and their parents would teach them that their life and death is tied to the success of their business. They might learn of people who starved to death or went to the poor houses and died because their business failed. Their parents would also teach them how the business worked and how small details, accurately keeping inventory, keeping a good reputation, maintaining low overhead, buying low and selling high, etc are all absolutely necessary to be successful, and to not die. And it wouldn't just be lip service for the parents. A merchant in those periods almost certainly understood how easily you could go from being successfully to being destitute and they would try to drive those principles into their children. A lot of it really was life and death for them, so they would be taught that anyone who failed to care about these details of merchant life basically didn't care about whether they all lived and died. Finally, the things that they understand about their parents business and about life and death get tied to the nation and to society as a whole. The idea that men doing their duty is to the nation what the fundamentals of merchant life are to the business and that failure to do one's duty IS death only on a much larger scale.
If you've read Carry on Mr. Bowditch or other books like it, you'll see aspects of this expressed. It doesn't have to be heavy-handed or preachy. The idea is to make it part their lives. This is the literally the fabric of society. It's what holds everything together, and everyone collectively believes it and enforces it as if their lives depend on it.
Let me know if that makes sense.