How to fit jam extensions to this window?
The right way to fix this is to cut out the spray foam insulation and move the window into proper position so that the two units align on a single plane. This isn't as difficult as it sounds. You can pilot and countersink some construction screws through the window frame at an upward angle into the framing to pull it outward if necessary. Work slowly and use caution and the window will move easily due to flex in the mounting flange. Be sure to keep shims in place to prevent the frame from bowing upward.

It looks like you have screws running through the window frame into the header. Many window manufacturers specifically prohibit this, as it increases the chance that settling will bow or jamb the window. I suggest removing them and reviewing the installation instructions. Andersen windows, for example, call for nailing through the outer flanges only (except where special clips are provided). (Correction: frame fastening is allowed, but is only done through the sides of the window.)

Otherwise, you'll have to use a jointer, powered hand planer, or sander to shape your extension jamb to the window. I wouldn't try to remove material from the window itself. You'd do this by holding the extension in place with the same gap to the window frame at each end. Measure that gap, and there you have the amount of wood that you need to remove at the center of the extension jamb, tapered evenly to the ends. How you remove the material depends on the tools you have on hand and your skill set.