A novel approach to study task organization in animal groups