Allow recording variables with arbitrary type in `StateMonitor`
_vectorisation_idx has to be an object with a length or an integer, it cannot be slice(None)