Transition from three-dimensional anisotropic spin excitations to two-dimensional spin excitations by electron doping the FeAs-based BaFe1:96Ni0:04As2 superconductor