Lower abdominal pain, low back pain and leg cramps that start just after your period have several possible causes. I can't tell which one applies without an exam and tests. The textbooks I checked point to a few that fit, and some of these need prompt attention.
If endometriosis is confirmed, treatment usually includes NSAIDs, hormonal options (combined pill, progestins, GnRH agents) or surgery. A recent
meta-analysis of drug treatments for endometriosis pain (PMID 41194364) looked at these options. I only saw the title and did not read the full text, so I can't summarize its results. The searches I ran did not show any recent evidence that contradicts the textbook information above.
With those I can narrow the likely causes.