Update: found the setting. In System Preferences, Mission Control.

A screenshot of the Mission Control setting panel in System Preferences. The first tick box is “Automatically rearrange Spaces based on most recent use”

Yorrike @yorrike