Fluid has not been changed. Car is 2005, as the topic indicated.
How many times has the tranny fluid been changed since new?
Caution: this may be a rhetorical question. 
Your car is over due for a transmission service. That is the first place to start solving this issue.
If you can DIY then these transmission services are relatively cheap. It's when the dealer gets involved it becomes expensive.
Any competent shop can do this. However, stay clear of jiffy lubes and transmission shops. They will not use the exact fluid required.
Pull out the tranny dipstick and read everything that is written on it. It should state exact type of fluid. An example would be "Type T-IV" Using wrong fluid = transmission death. If you go to a Mazda dealer make them show you the type of fluid because many dealers are useless and will install wrong fluid.
Don't allow a "flushing" machine to be used no matter what kind of BS they shoot you.
So if I were you, I'd get the filter changed along with about 4 litres of fluid (guessing here on amount). Then I'd run the car thru the gears until hot and then dump another pan full of fluid (but no filter change is time).
Every 48k is what you should aim for. With a filter every other fluid change.