Sudan agrees to 3-year transition to democratic government