Script that fixes YML SIDs to be simplified for production
You could use rumael.yaml, it can preserve comments. https://stackoverflow.com/questions/7255885/save-dump-a-yaml-file-with-comments-in-pyyaml#27103244

Moreover, you want to be a better python developer (or maybe pythonist?) I can give you some tips:

Content duplication
You are storing the file content inside cont and after closing the file you are duplicating that info in a new variable newfile I think that is an unnecessary process in this situation. You could store all the data in cont and just modify the lines needed. You can replace the entire if-else by:

    if temp != (refnum+1):              
        temp= (refnum+1)       
        change=numRegex.sub(str(temp), cont[i])
        cont[i] = change


For loop's range
Change your range call in the for loop to range(2, len(cont)):
Now inside the loop you can access the current line with simply cont[i] it's more readable and efficient.

As with i's range you are accessing refnum always with a +1. By initializing it as refnum=int(act.group()) +1 your code saves that operations inside the loop. Another thing that you can do is do the +=1 increment at the beginning of the loop.

File management
You don't need to manually close files when using with statement you can remove finalfile.close(). Another thing, you are using with in the when writing but not when reading, think about always use the same method.

More things can be changed but I think that's enough for now.