If you want to find and keep successful Product Owners (PO) and Scrum Masters (SM), it's crucial to set up those roles so that you attract the right talent.
Both the PO and the SM perform duties that are usually done by managers in traditional organizations. Both the PO role and the SM role are leadership positions. Therefore, you should seek to staff both roles with people who, in traditional organizations, could take a job called "manager". The PO and SM roles are by no means the same as the role of manager, but I see the skills needed by the PO and by the SM as being a strong subset of the skills needed by a manager in a traditional organization.
Sometimes, the people who the organization taps to fill their PO and SM roles are not yet ready to be a PO or an SM. This can be immensely stressful for the people who have been placed in a role that is beyond their current capabilities. Also, this misplacement puts both their team and their larger organization at risk when the PO or SM role isn't done well.
Both the PO and the SM should be people who can be "heads-up" as well as "heads-down", should have considerable experience, should have the respect of people throughout the organization, should have a track record for getting things done, should be persuasive, positive, and straightforward—all of these are also the qualities of a good manager.
Reading through this list, you can probably think of some people in your organization who meet these criteria. What are their current titles? What's their current salary? What are their current prospects and expectations for advancement? Whatever those answers are, you also need those things to be true about your PO roles and your SM roles if you want to attract and retain the talent you need.