You just need to research a target pokemon, click on it and after that you just need to click in the trainer's name. The own system will find all the pokemons of this trainer's name TID/SID in the same time.
Ps: Hayley's pokemons share the same ID/SID for all the languages. For example: Japanese, Spanish, English, Italian, German and French Mews will share the same ID/SID, and that looks really weird, but, that's Nintendo/GameFreak decision.