as soon as the onions start sticking to the pan, let them stick a little and brown, but then stir them before they burn. the trick is to leave them alone enough to brown (if you stir them too often, they won't brown), but not so long so that they burn.