Generative Artificial Intelligence: A Law and Economics Approach to Optimal Regulation and Governance