Although there were no outsiders here, Yang Ming couldn't guarantee that Bao Sanli wouldn't speak of his own matter! If he wanted Bao Sanli to shut up, he had to kill him. This was obviously not a good idea. As for the rest, he could only use his other identity to suppress him!
That was the boss behind-the-scenes, Mr. Y. Only by using his own behind-the-scenes boss identity to shock Bao Sanli, could he keep Bao Sanli from speaking about today's events.
It wasn't that Yang Ming didn't think that after intervening, he would go back and use the name of Mr. Y to command Bao Sanli to keep it a secret. But, that would be more problematic! Why did Mr. Y have to be kept secret for Yang Ming? Even if Bao Sanli was stupid, there was no relation between them at all. It was likely to raise his suspicion, so it was better to disclose his identity.
Moreover, the assassination matter was also a good opportunity to anchor his might.