Learning from Optimal Actions: Theory and Empirical Analysis in Digital Platforms