So at bitcoin.conf file, there we can set walletnotify option, and it only called when some transaction's confirmations are 0 and 1.
Can we increase this number?
If can't, we should revise coin's source code itself? where?
There is a wallet notification only when there is a wallet change, which happens when a new transaction enters the mempool (confirmation is 0) and when it enters the chain (confirmation will be 1).
In the case you want to have a notification when confirmation number reaches another number, like 6, the best is to keep track in a database confirmed transactions and to use -blocknotify to have a notification when a new blocks comes in. With those information, you'll be able to compute how much confirmation a transaction has (eg: current block number minus the transaction's block number).
Pseudo code:
In tx notify script:
tx = // the tx passed by argv[1]
tx_info = call gettransaction RPC on tx
block_info = call getblock RPC on tx_info['blockhash']
store in database(tx, block_info['height']) // store in db the tx & the block height
In block notify script:
hash = // the hash passed by argv[1]
confirmation_required = 6
// to retrieve all transactions from your table with confirmation_required number of required confirmation:
txs = select tx from your_table where hash['height'] = tx_block_height + confirmation_required
And you'll be done. You'll have all tx in your wallets with 6 confirmations.