The best way is to find an unobstructed view of the sky, use a tripod in a sheltered spot, (under a hatchback door, for example) set to around f8, with a release cable, and play music, using the length of a song as a (very) rough guide for keeping the shutter open.
You build up a series of flashes over time, rather than trying to anticipate each flash.
Of course this is at night, during daylight, you should use ND filters to extend exposure times.
A bit trial-and-error, but at least with digital you get to see the result straight away, and adjust to suit.
I had to use film when I tried it, with days of waiting for a result!
I got one or two, but not great ones, trying to use my phone.
Hardly ideal.
The clouds in that first photo are positively unreal! Very SciFi movie.
Well done, those are really good. 😀