How to differentiate between AddLiquidity and SwapEthForExactTokens on contract function execution?

We are trying to process a fee when tokens are "Sold" on PancakeSwap. For now "Sold" is when the user swaps their tokens for BNB. Initially our current logic would also charge a fee when adding to the LP. (Which is not considered a sell in our usecase)

We noticed Pancake uses AddLiquidityETH to transfer tokens to the LP, and SwapETHForExactTokens also performs the same action during execution.

How can we differentiate during execution time between AddLiquidtyETH or SwapETHForExactTokens?

Our current _transfer function looks as follows:

function _transfer(address from, address to, uint256 amount) private {

        require(from != address(0), "ERC20: transfer from the zero address");
        require(to != address(0), "ERC20: transfer to the zero address");
        require(amount > 0, "Transfer amount must be greater than zero");

        bool  chargeTax = true;
    
        if (from != owner() && to != owner() && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
            require(tradeAllowed);
            require(!_isBlacklisted[from] && !_isBlacklisted[to]);

            // buy
            if (from == pancakeswapPair && to != address(pancakeV2Router)) {
                if (limitTX) {
                    require(amount <= _maxTxAmount);
                }
                //  only buy tax
                chargeTax = buyFeeEnabled;
                setBuyFeeOnTrancation();
                

                uint contractETHBalance = address(this).balance;
                if (contractETHBalance > 0) {
                    swapETHfortargetToken(address(this).balance);
                }
            }

            //  sale 
            if(to == address(pancakeswapPair) || to == address(pancakeV2Router) ) {
                
                chargeTax = sellFeeEnabled;
                setSellFeeOnTrancation();

                uint contractTokenBalance = balanceOf(address(this));
                if (!inSwap && from != pancakeswapPair && swapEnabled) {
                    if (limitTX) {
                    require(amount <= balanceOf(pancakeswapPair).mul(3).div(100) && amount <= _maxTxAmount);
                    }
                    uint initialETHBalance = address(this).balance;

                    swapTokensForEth(contractTokenBalance);
                    
                    uint newETHBalance = address(this).balance;
                    uint ethToDistribute = newETHBalance.sub(initialETHBalance);
                    if (ethToDistribute > 0) {
                        distributeETH(ethToDistribute);
                    }
                }
                chargeTax = sellFeeEnabled;
                setSellFeeOnTrancation();

            }
        }
    
        
        
        bool takeFee = true;

        if (_isExcludedFromFee[from] || _isExcludedFromFee[to] || !feeEnabled || !chargeTax) {
            takeFee = false;
        }
        _tokenTransfer(from, to, amount, takeFee);
        removeAllFee;
    }

there is anyway to override addLiquidityEth function in smart contract so we can disable fee before execution function and enable after execution . i tried to overide pancakeswap function in smart contract but does't work .

 function addLiquidityETH(address token,uint amountTokenDesired,uint amountTokenMin,uint amountETHMin,address to,uint deadline) external payable returns (uint amountToken, uint amountETH, uint liquidity)
    {
        bool _temp_feeEnabled = feeEnabled;
        feeEnabled = false;

        ( amountToken, amountETH, liquidity) = pancakeV2Router.addLiquidityETH(token,amountTokenDesired,amountTokenMin,amountETHMin,to,deadline);
        feeEnabled = _temp_feeEnabled;

    }

please help me.