A Potential Game Perspective in Federated Learning