Spawn causes are attached to Pokémon spawned via either the fishing spawner or player spawner. This data lives on the Pokémon’s persistent data, at the tim_core:spawned_via string property, but you can also use the Pokemon::getSpawnCause extension function from Tim Core.
If, for any reason, you would like to disable Tim Core adding this data to Pokémon as they spawn, change the addSpawnCauseToData config option to false.