IDEAL characterization of isometry classes of FLRW and inflationary spacetimes