If Sun/Moon follow the pattern from other games, random generic trainers will have Pokemon with the same random IVs as any wild Pokemon you might encounter, while specific story people, like the Trial Captains and Kahunas will have specific IVs, Natures, and EV spreads.