He did improve though. Do you really think he would have beaten Djokovic in 2011 and had the season he had in 2012 is he hadn't?He still can improve by training more defensive skills, focused too much on attacking. I felt he stopped developing after 2006 and 2017, its one of the things he should have done to become the best by far. The competition overtook him by 2011. He needs better defense as his serve and ground strokes are good enough to hurt anyone. Many points he needs to slide and push.
The competition overtook him in 2011 because it was really tough. It wasn't 30 year old Federer against Tsitsipas and Medvedev. It was 30 year old Federer against peak Djokodal.