It's actually not really RNG. She does it if you range attack her too much and she also does it after you put her through different hp thresholds. If i remember it's 75/50/and 25 percent.
There is for sure a threshold (around 75%), but once you reach it she can use the move whenever she wants.
Here she does it two times in a row (0:29) without having sustained any damage.
Some guy is blasting her with sorceries in the background in that vid, that's what is triggering her to spam the dance, I mentioned that spamming ranged attacks cause this in my post. She doesn't even need to eat them, even if she used her dodge, simply trying to range dmg her without being in her melee range will trigger her to dance after a couple casts.
My first playthrough was a faith mage and trying to blast her with lightning spears was triggering the dance constantly.
My second playthrough on an STR char melee, the thresholds were verified every single time in phase 1 (again don't remember exactly which ones) as long as I didn't try to use kukris on her or something. Phase 2 is different there it seems that she can do it whenever
EDIT : it think I dertermined back then the thresholds are 75 and 25 percent HP. Again might be a time related factor too but she definitely was doing it in these two instances ( and she will do it again if she heals over those thresholds and you break them again)
This was my final attempt on the melee char and you can see there that I know when to take my distance and she does waterfowl dance on the clock after the string of attacks that puts her past 75 and past 25 ish percent HP. Might have been changed since then though.
Malenia is generally designed to punish you for being passive and rewards taking initiative which is very different to most souls bosses which reward you for being reactive. That's why she has this super generous 'walking stance' and is pretty passive in phase 1 letting you start the exchange. This also lets you back up more or less freely and heal, again fitting with the theme that you should be the one taking initiative on the trades. Interesting theme is that she absolutely gets fucked by ashes of war which can track her through her side steps and dodges, almost like typical boss/player mechanics of souls series are reversed.
Which contrasts with radagon for example who is a typical souls boss, aggressive but with huge windows on certain moves.