How would you handle this?
- Your intentions might be good, but it could backfire. The manager or company might not try to retain the team member like you expect. If they think the employee is leaving, they might rush to replace that person with someone who won't be leaving the company soon.
- Unless the team member explicit authorizes you to share the information, you should treat it as confidential. You would be violating that person's trust, which is nearly impossible to recover once broken.
- You put your own reputation at risk by breaking that person's trust. Once others learn that you shared confidential information with your manager, they'll assume you're not trustworthy. You can't afford to damage your own reputation.
- Put yourself in the team member's position. Would you want someone else to reveal your career plans to your manager?
The main reason it's a bad idea is that if your coworker decides not to leave after all, you've just limited their growth at your co, perhaps permanently, and invisibly to them.
I think the only way something like this could work is if you're able to find out the true largest source of unhappiness for the coworker, and then present it to your manager as a general problem (unattributed to your coworker) and say you're seriously worried it's starting to affect morale.
If you believe that your colleague is that critical, discuss it with him directly and discreetly, and maybe make a point of evangelizing him to the management (but do so without tipping anyone off—shouldn’t be too hard if the colleague is that critical).
Your colleague's career decisions are none of your business. Their relationship with management is none of your business.
Beyond that, the relationship between employee and employer should be professional. Professionals understand that people--even important people--sometimes leave, and they plan for that. Thinking you need to look out for the company is a misunderstanding of how the professional world works. If the company wanted to ensure a certain term of employment or provide some fallback in the event of someone wanting to leave, they would have written that into the contract and paid accordingly. They didn't, so they've knowingly accepted the risk of this person leaving.
The reason that I wouldn't do it is because I wouldn't be OK with violating the trust. Not only would it harm my relationship with that person, but it would signal to everyone else that I can't be trusted with sensitive information.
What I might do, though, is to try to engage in some knowledge transfer, to get that person to pass on the knowledge they have that makes the loss of them so devastating.