4-5 a year - probably not enough to take a preventative. usually only recommended if you are having several a month.
Yes they are hereditary.
Working out triggers is v helpful. Classics are:
Being dehydrated, being hungry, being out of routine - going to bed too late, not enough sleep, blue light from screens - you can adjust phones to avoid this and install an app on laptops etc, caffeine, alcohol. Lighting esp strip lights. fragrance. These are all things you can adjust for.
Weather especially thunder storms will do it but you can't really change that.
Hormones - periods would be a typical cause and so having contraception to avoid them eg mini-pill can help (life saver for me)
Then you may find you are triggered by dietary things like cheese but if it's only a few times a year, I am guessing you might eat cheese more often than that?
I am triggered by all of the above bar cheese, and have gone from having a daily migraine to one a month with massive effort on lifestyle + preventative.
It did take a while to work out all the triggers but most I can do something about.