The 20-time Grand Slam champion said that Anderson's run to the finals of the last year's US Open might have unlocked the belief that he could finally win a major tournament.
"I think the US Open might have unlocked a lot of things for Kevin in his head and in his game that maybe before he wasn't sure he could achieve," Sport24 quoted Federer as saying.
Anderson made it to the summit showdown following a 4-6, 7-5, 6-3, 6-4 win over Spain's Pablo Carreno Busta, only to see himself losing to the then top-ranked Rafael Nadal 3-6, 3-6, 4-6.
Describing Anderson as a "great player", Federer insisted that he has always been impressed by the South African's fighting attitude towards the game.
"I think he is a great player. I like his fighting attitude.He is going to go out swinging and trying his absolute best, and then good things can happen, absolutely," he added.
The Swiss star's comments came after he was honoured with Laureus World Sportsman of the Year and Comeback of the Year awards at the 2018 ceremony in Monaco.
The two awards for the Swiss brought his career total of Laureus Awards to six, making him the most decorated Laureus winner in history.
Last week, Federer returned to the top of the ATP Rankings for his fourth stint at the pinnacle of men's professional tennis, more than 14 years after he first became number one.