When the Yankees traded Carlos Beltran, the 2016 fire sale had already begun. When the club dealt Brian McCann, the youth movement was well under way. When they returned as Astros Thursday night at the Stadium, they found their former team rebuilt and ahead of schedule.

“I didn’t even know if they were expecting this,” said Beltran, who was sent to Texas, helped it reach the postseason and then signed with Houston as a free agent. “But I believe in talent, man. I believe in opportunities. For some people that’s all they need: the opportunity to play and not be worried they’re going to the minor leagues if they don’t perform.”

None has performed better than Aaron Judge, who entered play hitting .317 with a league-leading 13 homers to go with 28 RBIs.

“When you look at his track record, every time he gets promoted, it’s kind of a learning curve and then he figures it out. He’s done that at every level and he’s doing it this year,” McCann said. “Last year he figured out how they were pitching him. He got rid of the leg kick. Now you see what he’s doing — he’s on every pitch.”

Beltran remembered Judge struggling to get a consistent swing at one spring training and how he showed maturity in finding it. “Just for a time he wanted to try too hard and do more than what he’s capable of doing,” Beltran added of Judge’s 2016 struggles. “He doesn’t need to try to do anything different. He just needs to put the bat on the ball and the ball will fly. The guy is a huge human being. He is so strong and so powerful . . . If he’s consistent, [he’d hit] 40 for sure.”

Both ex-Yanks were accepting of what was happening as general manager Brian Cashman engineered their deals. Beltran had an .890 OPS with the Yanks when he was dealt and said Thursday, “I had a good conversation with Cashman about the situation and I let him know that he needed to do whatever was best for the team. At the end of the day, they did a great job.”

advertisement | advertise on newsday

McCann was dealt after a season in which he ceded most of the playing time to breakout star Gary Sanchez. “I wanted to catch every day and I knew here that wasn’t going to happen,” said McCann, who applied the tag on Jacoby Ellsbury on the final play of the game Thursday night in the Astros’ 3-2 win.

Beltran’s family still lives in the New York area — he picked up his children from school Thursday — and so his agent approached the Yankees in the offseason. “They had the priority to sign [Aroldis] Chapman,” Beltran said. “The Yankees want to wait a little more to make a move. I wasn’t going to wait.”

Though they are keeping an eye on former teammates — and the surging youngsters Judge, Sanchez and Luis Severino — Beltran and McCann are very happy with being senior leaders on a contender.

“It was about time that they needed to give the opportunity to play every day [to] Judge, Gary and [Luis] Severino in the rotation,” Beltran said. “It has worked out for them . . . This has worked out for me.”