It's very difficult as there is no standard identification method - whilst several manufacturer's use pink dye, some use green or blue and I've found some that are yellow just like non FR foams.
Whilst not infallible from the different manufacturer evidence I've seen over the years if it's aerosol can type expanding foam then generally if it's being used for anything other than very small linear gaps (not penetrations to said gaps) and narrow gaps to door frames (often capped to 10mm with mastic) then there's a very good chance it is an incorrect use that will fail spectacularly early (as graphically illustrated in the ASFP video).
Gun applied cartridge single & 2 pack non aerosol 'foams' such as specialist products from Hilti, Mulcol and others generally have a much wider scope of use including service penetrations and much larger holes and visually look quite different.