Yes, with major caveats.
If you look at the video Lio provided (in comments), you will see the basic principle of turning on and off electromagnets to cause a temporary pull toward another magnet.
However, the only reason the motor works as we expect is because the outer casing is mounted to something much more massive than itself; otherwise the torque of the magnetic attraction would move both the outer magnet and the inner magnet; in fact if the masses of the outer casing and inner rotor were precisely equal it may not spin at all; it might just jump back and forth between two positions. But because the outer casing is more rigid (resistant to being moved or rotated) and the rotor is free to rotate, enough impetus goes to the rotor to push it to the next stable position, and then momentum ensures it keeps going after that.
In space, the outer "fixed" part has no anchor; so both the fixed part and the spinner part are actually going to spin. Without any other frame of reference (like the sun, a planet, stars, etc), a person sitting on one will only see the other spinning. e.g. On the spinner, an observer would feel centrifugal acceleration (gravity), but would see the outer ring spinning above them. While on the outer ring, they would also feel some centrifugal acceleration, but would feel static and see the inner ring spinning below them.
To an outside observer (one whose position in space is not changing and is not a function of the two parts in question), both the inner and outer parts are rotating in opposite directions, with speeds relative to their respective masses (i.e. if the inner spinner is half the mass of the outer ring, the spinner is rotating twice as fast as the outer ring).
If there is a reference field the parties can trust is not rotating around them, like a visible sun, planet or field of stars, then both parties can deduce that they are spinning.
You can observe a form of this equal and opposite force phenomenon in a light table-top fan: when it is on the table becomes part of its anchor; and vibrates as the fan rotates; due to force applied to the casing which transfers to a force that slightly moves the tabletop.
So the caveat is; if you make it just like an induction motor, both parts will spin.
I have not engineered motors or rotors and don't know the latest tech, but I am not aware of any design that allows the outer ring to remain stationary without some kind of braking power. My wild ass guess is that any purely magnetic force must act on the spinner, and slow it down; due to the "equal and opposite" law, basically this is conservation of energy, or a no-free-lunch law.
So yes to spinning, and stabilization, relative to a fixed component, but the fixed component will not exactly be fixed to an outside observer, it will also be rotating, in the opposite direction. From the POV of construction, the centrifugal forces on the outer ring will cause stresses that must be dealt with in its design.