[RFC] Introduce the concept of IR listeners in MLIR

Related work in LLVM: [RFC] Lightweight LLVM IR Checkpointing