Bitcoin Core ZMQ "hashTx"
Both. A notification will be sent when a transaction is added to the mempool. For newly added blocks, a notification will be sent for every transaction in that block, so when a transaction is confirmed, there will be a notification for it.