Char the onion and ginger. Put them cut side up under a hot broiler for 8 to 10 minutes until properly blackened in spots, or hold them over a gas flame with tongs. Do not skip this. It is the single step that makes carton stock taste like pho.
While that happens, toast the star anise, cinnamon, cloves, and coriander seeds in a dry pot over medium heat for about a minute, until you can smell them across the kitchen.
Pour the stock into the pot, add the charred onion and ginger, fish sauce, and sugar. Bring to a bare simmer.
Slip the chicken breasts into the broth, drop the heat so it barely moves, and poach 15 to 18 minutes until just cooked through. A hard boil makes stringy chicken; a quiet simmer makes silky chicken.
Meanwhile, cook the rice noodles in a separate pot of water according to the package, drain, and rinse briefly. Never cook noodles in the broth, the starch clouds it.
Lift the chicken out, rest 5 minutes, and slice thin. Strain the broth and taste it. It probably wants another splash of fish sauce.
Divide noodles between four bowls, top with chicken and onion slices, and ladle the hot broth over. Serve with bean sprouts, herbs, and lime at the table.