Theory of Mind Enhances Collective Intelligence