One possibility is to add a custom header to the message context. In the specific case of the proposed example we could add a transformer after consuming from Topic A, adding some specific header which would be the basis for the filtering condition on the monitoring transformer after the join.
Another possibility would be to flag the message in the message content itself. In this case the transformer after consuming from Topic A would extend the message value with a boolean flag which would have to be propagated to the monitoring transformer.
Both options have pros and cons and should be considered depending on the specific use case. Flagging via context headers has a minimum impact but requires deserializing the headers for evaluating the flag-based filtering condition while flagging the message content itself makes the condition simpler to be evaluated but may require some refactoring/adaptation at other points of the topology.