Here is an example of an AppleScript that recursively explores a folder name for any files containing the keyword "stock" and then proceeds to prepend the string EP01_nnn to the original filename. Tested: macOS 11.6.1.
# prepend_stock.applescript
# Prompt user for folder containing candidate files, and then prepend string EP01_nnn
# to the filenames containing the "stock" keyword in their name.
use scripting additions
property PREFIX : "EP01_"
property KEYWORD : "stock"
property counter : 1 as integer
set theFolder to (choose folder default location (path to desktop))
tell application "Finder"
set flist to (every item of entire contents of folder theFolder whose name contains KEYWORD) as alias list
if flist = {} then return
repeat with afile in flist
set padcnt to text -3 thru -1 of ("000" & counter)
set pre_name to (PREFIX & padcnt) as text
set name of afile to pre_name & name of afile
set counter to counter + (1 as integer)
end repeat
end tell
set counter to 1
return
Launch the Script Editor, copy/paste the preceding code into it, click the compile (hammer icon), and then run it. It will process all files in the folder containing the word "stock" in them.