You would need to do it manually I think. There is no way to know where a 4th/5th gen Pokémon file that comes from 3rd gen was met (unless you know because its from an specific event or a legendary that can only be caught at a certain cave for example).