Text this: Optimal entanglement generation in optomechanical systems via Krotov control of covariance matrix dynamics