Dan Hamilton | USA TODAY Sports

The Yankees’ late-summer slump is officially over after a two-game sweep of the Red Sox.

Boston was completely outmatched by New York in both games, even with Tuesday’s tilt going into extra innings. Aaron Judge mashed, Gleyber Torres’ talented bat was rediscovered, and the pitching worked around a rough Gerrit Cole outing.

The magic number is down to 14, and the Yankees are getting hot right when they need to.

Some takeaways:

Torres has his groove back. Something has finally clicked and Torres is a reliable contact hitter again. He’s batting .375 in the Yankees’ last five games, including the game-winning double Tuesday and a Little League home run on Wednesday. Suddenly, DJ LeMahieu’s injury doesn’t loom so large.

This is the Torres the Yankees need with the playoffs around the corner. A deep October run is definitely possible if he has indeed rediscovered his swing.

The Judge makes his case. Two home runs on Tuesday put Judge’s total at 57 for the season. His passing Roger Maris seems almost inevitable and would be a great cap to the best contract year in baseball history. General manager Brian Cashman can wave the analytics flag all he wants. You don’t need sabermetrics to justify why Judge deserves a megadeal.

More help on the way? What’s astounding about the Yankees’ current four-game winning streak is just how shorthanded the team still is. On top of LeMahieu, Anthony Rizzo is still recovering from an epidural in his back. Luis Severino and Scott Effross are also still on the shelf with shoulder injuries.

The good news is Zack Britton, the newly acquired Harrison Bader, and (sigh) Aroldis Chapman are all on rehab assignments. Bader had a long home run for Somerset on Thursday, and Chapman is even expected to be activated in Milwaukee on Friday.

Thus, if this is how the Yankees win while shorthanded? Well, imagine what could be when Cashman’s Death Star is fully operational again.

Concern for Cole? Cole is the undisputed ace of the Yankees, but his inability to handle Fenway Park is becoming a concern. It’s bad enough he has a 4.28 ERA against Boston for his career. Cole and Fenway Park are almost as bad a match as Sonny Gray and Yankee Stadium. The big righty owns a 5.52 ERA in the shadow of the Green Monster.

It doesn’t matter that the Yankees only play Boston 13 times next year. They’re still a divisional rival who play their greatest adversaries hard, regardless of either’s standing. Expanded playoffs mean both teams could easily meet in October. There’s no magic cure here. Cole and his $324 million contract simply need to play better.

Follow ESNY on Twitter @elitesportsny

Josh Benjamin has been a staff writer at ESNY since 2018. He has had opinions about everything, especially the Yankees and Knicks. He co-hosts the “Bleacher Creatures” podcast and is always looking for new pieces of sports history to uncover, usually with a Yankee Tavern chicken parm sub in hand.