Unfortunately there is no way to customize the number of retries or to know when the retry occurs.
DF will only attempt retries on timeout exception, communication related exception, as well as exceptions related to ZLib, an open source library we use for compression.
If any other exception occurs, the call will not be retried and the exception is thrown back to the client. You can intercept the exception by hooking into the EntityManager.EntityServerError event.