Network Contexts and Social Identities Interact to Shape Beliefs and Behaviors