Generally if the entire cassette moves as one its the free hub [ and it wobbles as one /you can feel /see play] – assuming its separate cogs type – and if the gaps are between the cogs its not tight enough / a spacer has broken [ unlikely]
Axial play or radial play? Have you got the little 10spd washer/sim fitted? I installed a cassette once without the shim and the lock ring didn’t fully tighten up against the sprockets and the cassette rattled when ridden. Strangely it didn’t affect shifting so obviously a small amount of play.