How?
By hiring people in the first place who are mature enough to recognize that their job isn’t just writing code, it’s helping the company grow.
And hiring people who aren’t just motivated to succeed for themselves, but who are community-minded and want to improve things for the people around them and make the team as a whole better.
And by being consistent with messaging about this. If you need someone to take two hours per day this week for onboarding, make sure projects are scheduled and incentives aligned in such a way that a) you can confidently make onboarding their top priority for the week so it’s OK if other projects slip as a result, and b) the timeline for those other projects takes into account that the developer will be short 10 hours (not to mention almost certainly constantly interrupted and unable to achieve flow) this week.
If it's important for your company, then why is doing this job not part of their performance?! Of course they don't want to do it if it just takes away from duties they're judged on.