Spectral dimensions from the spectral action