Differents fees on buy/sell on PCS

Hello,

I want to have differents fees on buying or selling, for burning etc..

I found that we can maybe do that in the transfer() function, but how to detect it's a buying or selling transfer to apply the correct fees ?

Thanks for your help !