Theory of the generation and detection of carriers in ultrafast pump‐and‐probe spectroscopy of semiconductors