Two spectacular stakes were run at Belmont Park over the holiday weekend, and the Belmont Stakes will be contested next week, but none of these subjects is the principal topic of conversation in New York racing circles. There is one subject, one question, preoccupying trainers, officials and bettors:

How is Oscar doing it?

Probably no trainer in history has ever performed feats more amazing than those of Oscar Barrera this spring. He has been claiming infirm horses and transforming them magically. He has been running his horses with only three or four days' rest but has managed to keep them in consistent form. He equaled a New York record by winning nine straight races at Aqueduct.

Other trainers would gladly make a pact with Mephistopheles to learn his secrets. Officials have to be wondering how he does it. Bettors have learned that they must disregard all normal handicapping logic and rely on blind faith when Barrera runs a horse he has recently acquired.

Such as Dancer's Melody. The 4-year-old's career had been heading straight downhill ever since it began. Well-bred, sold for $140,000 as a yearling, he was able to win only a maiden race for legendary trainer Allen Jerkens. Herb Nadler claimed him for $25,000, but the colt ran dismally, continued to descend the class ladder and finally hit rock bottom. When Barrera claimed him for $8,500, an eyewitness reported that Nadler "danced a little jig," so glad was he to be rid of this hopeless creature.

Four days later Barrera entered Dancer's Melody in a $14,000 claiming race. He won by four lengths. Three days after that he put the colt in a starter-handicap race at 1 5/16 miles, a distance which would have been far beyond his capabilities at any stage of his career. He won by 10.

How is Oscar doing it?

Barrera is best known for his kinship to his illustrious brother Laz, a member of the Racing Hall of Fame, but he has always been an interesting, idiosyncratic horseman in his own right. He started training horses in his native Cuba in 1944 and came to this country two years later, though he never got the opportunity to handle high-class stock, as Laz did. Instead he has spent nearly four decades learning to deal with the infirmities of cheap claiming horses.

For years Barrera has amazed his peers by running his horses with a frequency that should have been (but usually isn't) destructive; one of his campaigners this spring, Hopehard, made eight starts in 41 days.

Barrera identified a type that responded to his special type of handling: well-bred male horses who have seen better days, whose performance has evidently been compromised by physical problems. When Barrera gets them, they somehow recapture their youth.

For example:

* He claimed Hot Words out of a $25,000 claiming race in which he finished eighth. Five days later the 8-year-old missed a track record at Belmont by two-fifths of a second.

He took Kenny J. from Bob DeBonis, one of the most astute claiming trainers in America, for $7,500. Kenny J. promptly captured four of his next five starts, winning for as much as $19,000.

* He claimed Ardent Bid for $8,000, and the gelding won five of his next seven starts, including a $32,000 claimer and two allowances.

Barrera could add to this list of miracles in today's daily double at Belmont. He claimed Joycapade three days ago for $15,000, a level at which he has been unable to win all year. The gelding is entered in the first race against $25,000 claimers. Barrera claimed a mediocre 3-year-old named Walkin' On Air last Friday out of a $16,000 race in which he finished fourth. Now Walkin' On Air is entered for $22,500 in the second at Belmont.

On paper, neither of these horses has a chance. But that never seems to stop Barrera's horses from winning and provoking even more questions and wonderment.