Structural bias and generalization in the learning of social structures