The decision to separate from the military or to push towards a 20-year retirement can be difficult and ultimately only you can make that decision.
I ended up leaving the Air Force after 10 years to go work for a tech company, which was a very different career path for me.
I've never had a career in law enforcement, but I know there are a lot of people in the military who make a successful transition from military to law enforcement. I don't think making that jump will result in more money for you, even in the long term. The military retirement after doing 20 years is just about the best deal out there for long-term financial stability and security. If you enlisted at 18, you could retire at 38 and begin to pull your pension the very next day after separation. Most other retirement plans make you wait until you are about 60 years old to begin seeing the benefit. After 20 years, you will also have health insurance for the rest of your life, which is a bigger benefit than most people realize.
Another option to consider would be to leave active duty, but stay in the Marine Corps as a part-time reservist. That way you can still work towards a military retirement while also working full-time in law enforcement. A reserves retirement isn't as good as active duty, but it is still good and absolutely better than nothing.