Learning to Balance Altruism and Self-interest Based on Empathy in Mixed-Motive Games