I
think I've worked out the rules for EV yield.
Pokemon that are the first in an evolutionary line give 1 EV
Pokemon that are second in an evolutionary line or aren't part of one (and aren't legendary) give 2 EVs
Pokemon that are third in an evolutionary line or are legendary/mythical/Ultra Beasts give 3 EVs
For legendary families, the prevo gives 1 EV, the evo gives 3. (Urshifu, Meltan, Poipole, etc. Larvesta and Volcarona also follow this rule, similar to how its Exp yield is legendary. Phione is treated as a prevo despite not evolving into Manaphy)
Mega Evolution doesn't affect EV yield - for example, Mega Mewtwo X still gives Special Attack EVs, not Attack, and Mega Slowbro still only gives 2 EVs, and follows the 7/20 formula. (Seems odd, because there are some in-battle form changes that affect EV yield, like Darmanitan or Minior)
Single-stage mons are a bit of an oddity - most of them give 2 EVs, but there is a fair number that give 1. (Chatot, Pachirisu, Smeargle, Delibird, Luvdisc, Castform, Spinda, Volbeat, Illumise, Plusle, Minun, Klefki, Carbink, and Furfrou) I suspect this is actually a sort of future-proofing - Nosepass, Sneasel, Gligar, Murkrow, and Aipom all gave 1 EV in Gen 3 - but I'm not positive. It seems unlike Castform or Furfrou would get evos, given their form gimmicks, and Girafarig has always given 2 EVs, and Farigiraf gives 3 now. Stantler and Qwilfish only give 1, but their evos seem to only give 1 as well? (Not positive, since they can't be transferred up yet)
And here's a really weird one - Falinks gives 3 EVs, and one of them is a Sp Def EV, even though that's its lowest stat! I genuinely think that one's an error that just didn't get caught.
Over time, EV yield has been moving away from mixed stats. In Gen 4, there were 22 new mons that gave EVs in more than one stat, but in Gen 8, there were only 2, both of which seem to be errors. (Falinks, as mentioned before, and Sobble, who gives 2 EVs when Grookey and Scorbunny only give 1 - that one's definitely an error, I'm sure of it) And it's not like there's been no opportunities - Cinderace's Attack is only 3 points less than its Speed, but it gives 3 Speed EVs rather than 2 Speed/1 Attack. (Compare that to Togekiss, whose Special Defense is 5 points less than its Special Attack, but it gives 2 Special Attack/1 Special Defense) It does make sense, mixed EVs seem to muddy training more than anything, but honestly, it just makes me think they should do away with Pokemon giving specific EV yields and instead go for an allocation system, like
Creg's or
DemICE's scripts.
Granted, there could be some fun concepts worth playing with in this form - pixie legendaries like Mew giving EVs in all stats rather than just 3HP, or Pokemon designed to be EV counterparts to Audino/Chansey that give high EVs in specific stats. (Maybe punching bag/boxing dummy inspired, haha) And I do like the friendship berries and power items, but with all the fuss the current system adds on the developer's end and the player's end...