A comparative approach to study collective behavior across biological scales