RAW, you probably don't know
The trigger for counterspell is:
when you see a creature within 60 feet of you casting a spell
Nothing in the rules explicitly models the amount of time it takes to cast a spell as either an action or bonus action. It's not like an action takes 5 seconds and a bonus action takes 1 second or something like that. Mechanically, both actions and bonus actions happen "immediately"–they both are discrete events that can only be interrupted if an effect specifically says so (such as the trigger for counterspell). So while spells with a casting time of 1 bonus action are described as "especially swift", there is no explicit mechanical implication for this swiftness. Regardless of whether a spell's casting time is 1 action or 1 bonus action, there is only one "decision point" at which you can choose to counter that spell.
Your DM could rule otherwise (but probably shouldn't)
Despite the above, the fact remains that bonus action spells are described as "especially swift", and this logically represents an easily observable difference between such spells and spells with the "normal" casting time of 1 action. In 5e, the DM has broad latitude to "fill in the blanks" where rules aren't spelled out explicitly, so they could decide that you can observe a caster and determine that the spell they're casting has taken longer than what would be required for a bonus action casting time, before the spell's casting is complete, thus giving a window to still cast counterspell.
However, I would probably recommend against further complicating the casting of counterspell in this way. Adjudicating the timing of reactions that preempt their triggers is already tricky in practice, and the added complexity of this "two-phase timing window" for counterspell may just bog the game down every time a spell is cast, while ultimately having very little effect on the outcome of any encounter. That's not a favorable trade-off for having fun with the game.