2015 Subaru Forester hesitates occasionally on acceleration usually at slow speeds. Some days drives perfectly then messes up the next day.
For such a new car, I would ask the dealership to fix the problem. There is probably some form of warranty. If it's over, you may have luck with basing your requirements for fixing the thing on consumer protection laws.
But I would assume based on the problem that it may be related to ignition. Is there any error code? New cars will usually detect such problems automatically.
Can you detect any pattern on the occurrence of the problem? Such as problem occurs on a rainy day. Or problem occurs when engine is at operating temperature. Or problem occurs with a cold engine.