How can I control the "Lock Actor Movement" in the scene outliner via C++?

I’m trying to make a tool in the editor which requires locking some actors’ transforms, however doing this one by one is tedious so I would like to be able to do so via a script.

(talking about this)