The Brezis--Nirenberg Problem on $\mathbb{S}^n$, in spaces of fractional dimension