In several international collaborative projects I am working, it happens that in some cases I have to teach and do a thorough supervision of PhD students from the other groups. This is something that I like and I am motivated to do, but in such situations I think I might deserve to be her/his PhD co-advisor. I could ask this directly to her/his first PhD advisor, but I prefer better to ask the student first. What is in your experience the best way to suggest this to the student? Of course I would respect her/his opinion. For me the main advantage is that the hard work I am doing would be merited on my CV and for promotion/habilitation aspects. Besides, I do not think this would harm her/his PhD, but just the other way around.
I worry about the politics of it and urge a bit of caution. The relationship between the student and the formal advisor is essential to completion of the degree. The politics arises because there is the issue of the personality of the formal advisor and how s/he would interpret such a "move". I think it would be vastly different for different people. Some would take it as very helpful. Others as interference.
I think the best way is to propose it jointly to the student and the advisor and using somewhat tentative language. "I'm happy to help out there. Is there some way that we can come to a formal arrangement?"
You don't want the student to be conflicted. You don't what the advisor to be annoyed. And most of all, you don't want the student to be getting different, possibly conflicting, advice from you and the formal advisor.
However, there isn't really anything wrong with your intent. Just be sure you know the personalities and what the worst case scenario might be. Eyes open.
I could ask this directly to her/his first PhD advisor, but I prefer better to ask the student first.
That's the part that worries me. The student is irrelevant, and most of the time not experienced enough to be useful in administrative situations. Putting that idea in the mind of the student will, at best, waste time, at worst, backfire and drive a wedge between the student and the advisor. Bad idea all around.
Ask the advisor. They will be the only one that actually knows the lay of the land, the administrative/funding caveats.
More than that, anything academically related to my students is my business, going behind my back to one of my students proposing an official cross-institution/group arrangement would raise all kinds of red flags.