Towards Optimal Feature-Shaping Methods for Out-of-Distribution Detection