Transient obscuration event captured in NGC 3227. II. Warm absorbers and obscuration events in archival XMM-Newton and NuSTAR observations