i think this is where the difference between natural skill and learned ability is apparent
i see some players are able to almost subconsciously adapt to new situations/habits
or they are just good as a whole at seeing and acting accordingly due to a number of variables
i think those fall under the category of natural skill
if you are not one of those people, or even if you are, one way to assuredly adapt quickly to a lot of tricks/playstyles is to gain experience against them
if your friends roll when you put them near the edge, and you punish it all the time, even if ur fighting mango and you put him near the edge and he rolls you will punish it
so assuming your fighting mango and you put him near the edge, and he shields wavedashes out and shines you, when this happens to you enough you will find a counter to it, and you'll be able to pull it out of your big book of counters in the future for if any other fox does that
basically if you struggle w/ adapting on the fly, you just need to cause those tricks/gimmicks to happen more so you can practice against them
if you play someone new, and you get wrecked by spot dodges, and your friends never spot dodge
try to make them spot dodge, spam grabs or something, get them to spot dodge then counter it
also i think you can train yourself to adapt quickly by consciously causing situations that you need to adapt to to occur
basically like the example i gave, if you focus some time on adapting, it becomes a part of your playstyle, more the more you focus on it