The difficult thing about legitimacy is its empirical 'catch': how do you 'see' it? The risk is great to define it in a circular way. Any regime which is not strongly contested may be called legitimate. Why is it legitimate? Because it is supported. Why is it supported? Because it is legitimate.
To avoid this circle, it is important to allow for regimes to be stable not because people support it, or because it has some other legitimacy, but because of habit. And that can change quickly (see Lybia, Syria). Hence: stability and legitimacy are not necessarily connected (if they are: circularity). And that works also the other way round: not because a system is contested, that it is necessarily illegitimate. It depends on the type of support and contestation.
Fritz Scharpf has written on legitimacy in a less political theory style and distinguished between input-legitimacy (how well does a political system respond to input from society) and output legitimacy (how efficient does the political system implement generally acceptable rules). That difference is to some extent important, because some systems may be very democratic and responsive, but inefficient and hence lose legitimacy (see Italy). Others may be highly unresponsive but able to well deliver the goods and hence legitimate. The implications are that the first one will not gain by getting more democratic responsiveness but efficiency (the Monti government in Italy) and the second may be highly dependent on delivering: if it does no longer (the oil money is no longer enough, corruption, whatever), then the fact of having no input legitimacy comes back with a vengence.