One way to achieve that would be to add a form script that calls rest-ws endpoint "/rest-ws/service/dms/lock/{id}".
But this has 2 problems:
1. The lock is only released if you actually change the index data and save that change.
2. The object is automatically locked every time the form is loaded, which also happens right after you change something in the index data.
To get around this you would have to add some kind of checkbox that would allow you to lock the object when you activate it. Then the lock would automatically be released after save.
But that would mean that every user would have to lock the object manually.