Social influence and interaction bias can drive emergent behavioural specialization and modular social networks across systems