The sign problem across the QCD phase transition