Beyond the isotropic two-dimensional Heisenberg model: Raman scattering studies of the transition between isotropic and anisotropic spin dynamics in Sr2IrO4