Quantifying degeneracy in singular models via the learning coefficient