This would be a better question for the service and repair section at the top of the forum section list.
Yes it could be a speed sensor.
It would help to have a scanner hooked up when it starts having the problem to see if the mph on the scanner are
doing the same thing as the speedometer.