The book,'From Abandoning the Throne to Cultivating Immortals', might fit the plot you described. After the protagonist transmigrated to become the Crown Prince, he wanted to be a wise ruler. However, on the eve of his ascension, he obtained a cultivation secret manual and decided to give up the throne to cultivate.