An evolutionary framework for studying mechanisms of social behavior