The easiest way is to keep working on projects with them. If that ship has sailed, then the next best way is to be friends with them on social media, which is to say, be friends with them in real life. Barring that, you have to work to communicate with them on a regular basis about topics relevant to your shared interests: go to conferences and strike up conversations with them, share interesting papers with them via email (i.e., "Did you see this new paper from prof X? What'd you think?"), propose joint projects and write joint grant proposals, etc. It's not hard, but it does take active work.
People definitely do this, and I think it's one of the best ways for a new post-PhD researcher to get experience writing grants and proposing projects if they haven't gotten that experience already. That being said, it's also hard. You're supposed to be striking out on your own and establishing new frontiers. Your old colleagues are either doing the same thing or using the slot you left to pay new students/postdocs to continue the work you left behind. It can be challenging for everyone to strike the right balance.