I am trying to track transactions in the mempool that utilize Replace-By-Fee (RBF). My approach involves saving the current transactions in the mempool and comparing them to newly added transactions. If a new transaction shares inputs with a previously saved transaction, I infer that it replaced the original transaction via RBF. In such cases, I save both the original and the replacement transactions for further analysis.
My question is, if instead of doing all this, is there any method in which the Bitcoin core to tell me when a transaction has used RBF.