[W]hose quote or idea is this?
The quote, or at least most of it, appears in,
Politics against domination: A conversation with Sterling Professor Ian Shapiro, June 8, 2016
What factors determine whether a democratic system will take hold and survive?
You need alternation: what political scientists call the “two turnover rule.” They don’t like to call a country a democracy until a government has twice lost an election and given up power. If a country has two or three turnovers they tend to continue. [Emboldening added.]
It appears that the quote comes from Ian Shapiro, a Sterling Professor of Political Science at Yale University.
Note that Ian Shapiro is the instructor of the course, Moral Foundations of Politics, referenced in the question.
The idea comes from Samuel P. Huntington and the book, The Third Wave: Democratization in the Late Twentieth Century, 1991, and is called the "two-turnover test".