Coulomb correlations in 4d and 5d oxides from first principles—or how spin–orbit materials choose their effective orbital degeneracies