We report an experimental and computational study of the Hall effect in Mn$_{rm 1-x}$Fe$_{rm x}$Si, as complemented by measurements in Mn$_{rm 1-x}$Co$_{rm x}$Si, when helimagnetic order is suppressed under substitutional doping. For small $x$ the anomalous Hall effect (AHE) and the topological Hall effect (THE) change sign. Under larger doping the AHE remains small and consistent with the magnetization, while the THE grows by over a factor of ten. Both the sign and the magnitude of the AHE and the THE are in excellent agreement with calculations based on density functional theory. Our study provides the long-sought material-specific microscopic justification, that while the AHE is due to the reciprocal-space Berry curvature, the THE originates in real-space Berry phases.