From most counts, Charles and Sarah are of the same generation, while Sophie both is and isn't (Edward, on the other hand, is).
The Baby Boom generation is the generation born between 1946 and 1964 - making Charles, his siblings, and both his maternal cousins all Baby Boomers.
Sophie, however, is Generation X, which covers those born between about 1965 and 1985 (some counts start Gen X at 1963, which would make Sarah and Edward Gen X as well). In addition to Sophie, this also includes the Phillips and the Wales children. In contrast, the Yorks, Wessexes, Chattos, and Armstrong-Joneses would be Gen Y or Millennials.
From a familial generation approach, however, Charles, his siblings, his cousins, and their respective spouses are all of the same generation as they're all grandchildren (or spouses of grandchildren) of George VI. Similarly, the Wales, York, Wessex, Phillips, Chatto, and Armstrong-Jones children are all of the same generation because they're all great-grandchildren of George VI.