Accurate Prediction of Phase Transitions in Compressed Sensing via a Connection to Minimax Denoising