A General Approach to Rational Learning in Games