Luck, this cannot be analyzed, whatever method you choose, this cannot be analyzed even with mathematics (IMO). Personally, I won't be able to say how luck works itself. Even in life outside of gambling, we often experience luck without knowing the exact time. It's the same as gambling, when you think a weak team can win a big team, and you bet on the weak team and it turns out to win, that is part of luck. Or, when you bet $0.2 to win $2,000, maybe you wouldn't think it was possible, that's also luck. Can you analyze the win? Of course it won't be possible.
They say that luck is a factor of what we are doing, so if we are to analyse a thing, let say a gambling game, we might actually increase our luck percentage. Gambling has odds or numbers, just like what we had in Mathematics, so learning how to read the odds and doing some calculations can as well increase our chances of winning or reduce our chances of losing.
Luck outside might only differ a little from luck in gambling because you said we may not expect it as we can be doing random things but when we are gambling, it is intentional and like we said earlier, we can also do an analysis if we are that desperate of earning a profit.