>>41783672That's one method.
There's two, and they stack.
The more times you KO a Pokemon species, regardless of chaining, the shiny rate for it goes up. This caps at 500 KOs.
Then there's the actual Chain, by KOing the Pokemon in a row, the shiny rate goes up. This method caps at 25.
I don't think the rates have been confirmed, but having 500 total KO's and a chain of 25 will give you the highest odds of finding a wild shiny of that species of Pokemon.
Running away breaks the chain, apparently. So to answer OP, I don't think there's a way to chain Milcery and other Random encounters.
Might be wrong, maybe you're allowed to run away when building the 25 consecutive KO chain?