There is an ‘option_name’ in $wpdb->options called ‘permalink_structure’ that installs with an empty value. If you change the permalink structure it then stores a string similar to this: ‘/%year%/%monthnum%/%day%/%postname%/’ I suspect that that is the trigger but I haven’t tested it. There are almost certainly some built in functions to manipulate that option but I don’t have the time to dig for them.
Pretty permalinks only work on some server configurations. You could cause users some headaches by enabling this automatically, and if you count on permalinks your theme will only work on some servers. This doesn’t seem like a very good idea to me, respectfully.