Use the "db2expln" tool. When creating the access plan, DB2 estimates the costs (in a unit called "timerons"). If you want to get the actual execution times, have a look at "db2batch".
Given the complexity of the DB2 optimizer and the different environment, there will be no way to get an exact formula for query execution costs. Some approximations exist, however. For example, one approach estimates page/index accesses and assigns times to each (like 10 ms per physical page read, .01 ms per logical page read, ...)