Cortical dynamics underlying social behavior in dominance hierarchy and spatial navigation