So what's the common link to play declining gracefully or little, and not precipitously?
I think the players who generally lasted longest are recognized as having outstanding footwork and desire to keep competing, along with the ability to stay relatively healthy.
There's another point which helps lasting long imo is having quite a "symmetric game" on the forehand and backhand, which helps playing great with less need for movement.
In a context where usually backhand is the players' weakest shot, it's quite the same as saying having a very good backhand.
Rosewall, Agassi and Connors had that, Lendl also had quite a good backhand, Federer less, and he has much used turning around his backhand to win. That looks even more important in modern time imo because the courts are slow then grinders are rewarded, then players who have no weak side are rewarded, then backhands in general have never been as good as now imo.
Then I don't think he has the best points to win for a very long time like these players (although having a great serve also helps because usually players don't lose their serve with age, except if they have problems with their back or shoulder).
But it's another topic than the one about his retirement : he may keep on playing with a light schedule and a bad ranking