I have a numbet of sebaceous cysts on the back of my thighs that flare during times I get my period or depending on my diet, what can I do?

Need evaluation. Unless a doctor told you that the lesions are sebaceous cysts, you may not have them. Back of the thigh is not a usual site for sebaceous cysts. It would be prudent to consult a doctor for an evaluation and if needed, a biopsy.
For good health - Have a diet rich in fresh vegetables, fruits, whole grains, milk and milk products, nuts, beans, legumes, lentils and small amounts of lean meats. Avoid saturated fats. Drink enough water daily, so that your urine is mostly colorless. Exercise at least 150 minutes/week and increase the intensity of exercise gradually. Do not use tobacco, alcohol, weed or street drugs in any form.
Practice safe sex, if you have sex.
Get HPV vaccine.
Recommend. medical assessment by your primary care provider or a dermatologist. This is normal.
Sebaceous cysts. can be removed by your doctor or a specialist. Please see a professional who will tell you if that is as reasonable way to proceed. Peace and good health.