There isn't an option in Bitcoin Core to broadcast a transaction to only Tor peers and not clearnet peers. Of course it is possible to do this if you write custom code but it isn't supported in Bitcoin Core as is. There is discussion in this draft pull request (#27509) to enable something like this.
If you only want your transaction broadcast to Tor peers you could disconnect from your clearnet peers before broadcasting. You'd have to be pretty motivated by avoiding any sort of privacy leak to do this. It isn't obvious to most nodes on the network which transactions you are broadcasting and which transactions you are just relaying from other peers that they haven't seen yet. But the set of transactions that they see first from you are a starting point for trying to identify which transactions are originating from your node in the first place.